예제 #1
0
class SignatureTests(TestCase):
    def setUp(self):
        self.signature = Signature("Gunther Cox")

    def test_add_timestamp(self):
        """
        Tests that the correct timestamp is returned.
        """
        import datetime

        fmt = "%Y-%m-%d-%H-%M-%S"
        time = self.signature.create_timestamp(fmt)

        now = datetime.datetime.now().strftime(fmt)

        self.assertEqual(time, now)

    def test_serializer(self):
        data = self.signature.serialize()
        self.assertEqual(self.signature.name, data["name"])
        self.assertEqual(self.signature.time, data["time"])
예제 #2
0
class SignatureTests(TestCase):

    def setUp(self):
        self.signature = Signature("Gunther Cox")

    def test_add_timestamp(self):
        """
        Tests that the correct timestamp is returned.
        """
        import datetime

        fmt = "%Y-%m-%d-%H-%M-%S"
        time = self.signature.create_timestamp(fmt)

        now = datetime.datetime.now().strftime(fmt)

        self.assertEqual(time, now)

    def test_serializer(self):
        data = self.signature.serialize()
        self.assertEqual(self.signature.name, data["name"])
        self.assertEqual(self.signature.time, data["time"])
예제 #3
0
 def test_add_signature(self):
     signature = Signature("Gunther Cox")
     self.response.add_signature(signature)
     self.assertIn(signature, self.response.signatures)
예제 #4
0
 def setUp(self):
     self.signature = Signature("Gunther Cox")
예제 #5
0
 def setUp(self):
     self.signature = Signature("Gunther Cox")
예제 #6
0
 def test_add_signature(self):
     signature = Signature("Gunther Cox")
     self.statement.add_signature(signature)
     self.assertIn(signature, self.statement.signatures)