def test_datetime_to_str_str(self): """ Given: datetime object When: converting datetimes to strs Then: validate the value is a string. """ raw = Client.datetime_to_str(self.datetime_obj) assert self.datetime_str == raw
def test_datetime_to_str_list(self): """ Given: list containing datetime object When: converting datetimes to strs Then: validate the value is a string. """ raw = Client.datetime_to_str([self.datetime_obj]) assert [self.datetime_str] == raw
def test_datetime_to_str_dict(self): """ Given: dict containing datetime object When: converting datetimes to strs Then: validate the value is a string. """ raw = Client.datetime_to_str({'time': self.datetime_obj}) assert self.datetime_str == raw['time']
def test_datetime_to_str_str_no_datetime(self): """ Given: 'str' When: converting datetimes to strs Then: validate the value returned is 'str'. """ raw = Client.datetime_to_str('str') assert 'str' == raw
def test_datetime_to_str_list_no_datetime(self): """ Given: list containing an int (5) object When: converting datetimes to strs Then: validate the value returned is 5. """ raw = Client.datetime_to_str([5]) assert [5] == raw
def test_datetime_to_str_dict_no_datetime(self): """ Given: dict containing 5 (int) When: converting datetimes to strs Then: validate the value returned is 5 """ raw = Client.datetime_to_str({'time': 5}) assert 5 == raw['time']