def test_states(self):
        """Test parsing the different response types."""
        rss = RemoteServiceStatus(load_response(_RESPONSE_PENDING))
        self.assertEqual(ExecutionState.PENDING, rss.state)

        rss = RemoteServiceStatus(load_response(_RESPONSE_DELIVERED))
        self.assertEqual(ExecutionState.DELIVERED, rss.state)

        rss = RemoteServiceStatus(load_response(_RESPONSE_EXECUTED))
        self.assertEqual(ExecutionState.EXECUTED, rss.state)
    def test_states(self):
        """Test parsing the different response types."""
        rss = RemoteServiceStatus(
            load_response_json('G31_NBTevo/RLF_INITIAL_RESPONSE.json'))
        self.assertEqual(ExecutionState.PENDING, rss.state)

        rss = RemoteServiceStatus(
            load_response_json('G31_NBTevo/RLF_PENDING.json'))
        self.assertEqual(ExecutionState.PENDING, rss.state)

        rss = RemoteServiceStatus(
            load_response_json('G31_NBTevo/RLF_DELIVERED.json'))
        self.assertEqual(ExecutionState.DELIVERED, rss.state)

        rss = RemoteServiceStatus(
            load_response_json('G31_NBTevo/RLF_EXECUTED.json'))
        self.assertEqual(ExecutionState.EXECUTED, rss.state)
Esempio n. 3
0
 def test_parse_timestamp(self):
     """Test parsing the timestamp format."""
     timestamp = RemoteServiceStatus._parse_timestamp(
         "2018-02-11T15:10:39.465+01")
     expected = datetime.datetime(year=2018,
                                  month=2,
                                  day=11,
                                  hour=15,
                                  minute=10,
                                  second=39,
                                  microsecond=465000)
     self.assertEqual(expected, timestamp)