Esempio n. 1
0
 def test_init__reject_no_name(self):
     with pytest.raises(AssertionError):
         Trophy(self.reddit, {})
     with pytest.raises(AssertionError):
         Trophy(self.reddit, {'id': 'abcd'})
Esempio n. 2
0
 def test_init__str_returns_name(self):
     name = 'Inciteful Link'
     trophy = Trophy(self.reddit, {'name': name})
     assert str(trophy) == trophy.name == name
Esempio n. 3
0
 def test_init__reject_non_dict(self):
     with pytest.raises(AssertionError):
         Trophy(self.reddit, None)
     with pytest.raises(AssertionError):
         Trophy(self.reddit, '')
Esempio n. 4
0
 def test_repr(self):
     name = "Inciteful Link"
     trophy = Trophy(self.reddit, {"name": name})
     assert repr(trophy) == "Trophy(name='Inciteful Link')"
Esempio n. 5
0
 def test_equality(self):
     name = "Inciteful Link"
     trophy = Trophy(self.reddit, {"name": name})
     assert trophy != 5
Esempio n. 6
0
 def test_init__str_returns_name(self):
     name = "Inciteful Link"
     trophy = Trophy(self.reddit, {"name": name})
     assert str(trophy) == trophy.name == name