예제 #1
0
 def test_field_name(self):
     spam = Spam()
     assert spam.field_name() == 'Spam'
예제 #2
0
 def test_default_value(self):
     spam = Spam()
     assert spam.value == False and spam.score == 0.0 and spam.threshold == 0.0
예제 #3
0
 def test_user_value(self):
     spam = Spam(value=True, score=4.0, threshold=2.0)
     assert spam.value == True and spam.score == 4.0 and spam.threshold == 2.0
예제 #4
0
 def test_repr(self):
     spam = Spam(value=True, score=4.0, threshold=2.0)
     assert repr(spam) == 'Spam(value=True, score=4.0, threshold=2.0)'
예제 #5
0
    def test_bytes(self):
        spam = Spam(value=True, score=4.0, threshold=2.0)

        assert bytes(spam) == b'Spam: True ; 4.0 / 2.0\r\n'
예제 #6
0
    def test_instantiates(self):
        spam = Spam()

        assert 'spam' in locals()
예제 #7
0
def test_user_value():
    spam = Spam(value=True, score=4.0, threshold=2.0)

    assert spam.value is True
    assert spam.score == 4.0
    assert spam.threshold == 2.0
예제 #8
0
def test_default_value():
    spam = Spam()

    assert spam.value is False
    assert spam.score == 0.0
    assert spam.threshold == 0.0