-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed
abc.Adjustment
comparison method;
- Loading branch information
1 parent
ca519e1
commit 4254090
Showing
3 changed files
with
132 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
import scrivid | ||
|
||
import pytest | ||
|
||
|
||
def test_defined_adjustment(): | ||
class Mock(scrivid.abc.Adjustment): | ||
@property | ||
def activation_time(self): | ||
return None | ||
|
||
def _enact(self): | ||
return None | ||
|
||
Mock() | ||
|
||
|
||
def test_defined_qualm(): | ||
class Mock(scrivid.abc.Qualm): | ||
def _comparison(self): | ||
return None | ||
|
||
def _message(self): | ||
return None | ||
|
||
@classmethod | ||
def check(cls): | ||
return None | ||
|
||
Mock() | ||
|
||
|
||
def test_undefined_adjustment_activation_time_property(): | ||
class Mock(scrivid.abc.Adjustment): | ||
def _enact(self): | ||
return None | ||
|
||
with pytest.raises(TypeError): | ||
Mock() | ||
|
||
|
||
def test_undefined_adjustment_activation_time_not_property(): | ||
with pytest.raises(scrivid.errors.TypeError): | ||
class _(scrivid.abc.Adjustment): | ||
def activation_time(self): | ||
return None | ||
|
||
def _enact(self): | ||
return None | ||
|
||
|
||
def test_undefined_adjustment_enact(): | ||
class Mock(scrivid.abc.Adjustment): | ||
@property | ||
def activation_time(self): | ||
return None | ||
|
||
with pytest.raises(TypeError): | ||
Mock() | ||
|
||
|
||
def test_undefined_qualm_check(): | ||
class Mock(scrivid.abc.Qualm): | ||
def _comparison(self): | ||
return None | ||
|
||
def _message(self): | ||
return None | ||
|
||
with pytest.raises(TypeError): | ||
Mock() | ||
|
||
|
||
def test_undefined_qualm_comparison(): | ||
class Mock(scrivid.abc.Qualm): | ||
def _message(self): | ||
return None | ||
|
||
@classmethod | ||
def check(cls): | ||
return None | ||
|
||
with pytest.raises(TypeError): | ||
Mock() | ||
|
||
|
||
def test_undefined_qualm_message(): | ||
class Mock(scrivid.abc.Qualm): | ||
def _comparison(self): | ||
return None | ||
|
||
@classmethod | ||
def check(cls): | ||
return None | ||
|
||
with pytest.raises(TypeError): | ||
Mock() |