Пример #1
0
    def test_duration(self):

        config = AutoRestDurationTestServiceConfiguration(base_url="http://localhost:3000")
        config.log_level = log_level
        client = AutoRestDurationTestService(config)

        self.assertIsNone(client.duration.get_null())

        with self.assertRaises(DeserializationError):
            client.duration.get_invalid()

        client.duration.get_positive_duration()
        client.duration.put_positive_duration(timedelta(days=123, hours=22, minutes=14, seconds=12, milliseconds=11))
Пример #2
0
    def test_duration(self):

        cred = BasicTokenAuthentication({"access_token" :str(uuid4())})
        config = AutoRestDurationTestServiceConfiguration(cred, base_url="http://localhost:3000")
        config.log_level = log_level
        client = AutoRestDurationTestService(config)

        self.assertIsNone(client.duration.get_null())

        with self.assertRaises(DeserializationError):
            client.duration.get_invalid()

        client.duration.get_positive_duration()
        delta = timedelta(days=123, hours=22, minutes=14, seconds=12, milliseconds=11)
        client.duration.put_positive_duration(delta)