Beispiel #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"])
Beispiel #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"])
Beispiel #3
0
 def test_add_signature(self):
     signature = Signature("Gunther Cox")
     self.response.add_signature(signature)
     self.assertIn(signature, self.response.signatures)
Beispiel #4
0
 def setUp(self):
     self.signature = Signature("Gunther Cox")
Beispiel #5
0
 def setUp(self):
     self.signature = Signature("Gunther Cox")
 def test_add_signature(self):
     signature = Signature("Gunther Cox")
     self.statement.add_signature(signature)
     self.assertIn(signature, self.statement.signatures)