Exemplo n.º 1
0
    def test_get_previous(self):
        expected = self.previous_record
        actual = NistBeacon.get_previous(self.target_timestamp)

        self.assertTrue(actual.valid_signature)
        self.assertEqual(expected, actual)
        self.assertIsNot(expected, actual)
Exemplo n.º 2
0
    def test_get_previous(self, requests_get_patched):
        mock_response = Mock(spec=Response)
        mock_response.status_code = 200
        mock_response.text = self.expected_previous.xml
        requests_get_patched.return_value = mock_response

        previous_record = NistBeacon.get_previous(
            self.reference_timestamp
        )
        self.assertEqual(self.expected_previous, previous_record)