Esempio n. 1
0
class TestBread(TestCase):
    def setUp(self):
        self.bread = Bread()

    def test_dict(self):
        table = self.bread.to_dict()
        bread_converted = Bread(**table)
        self.assertEqual(self.bread.to_str(), bread_converted.to_str())

    def test_json(self):
        data = self.bread.to_json()
        bread_converted = Bread(**json.loads(data))
        self.assertEqual(self.bread.to_str(), bread_converted.to_str())

    def tearDown(self):
        pass
Esempio n. 2
0
 def test_json(self):
     data = self.bread.to_json()
     bread_converted = Bread(**json.loads(data))
     self.assertEqual(self.bread.to_str(), bread_converted.to_str())
Esempio n. 3
0
 def test_dict(self):
     table = self.bread.to_dict()
     bread_converted = Bread(**table)
     self.assertEqual(self.bread.to_str(), bread_converted.to_str())