Пример #1
0
 def test_attrs_from_server(self):
     values = {'tags': 'foo,bar',
               'timestamp': '2015-04-15 12:00:00+0300',
               'ignored1': 'just a string',
               'ignored2': 123}
     out = utils.attrs_from_server(values)
     assert out['tags'] == ['foo', 'bar']
     assert out['timestamp'] == iso8601.parse_date(
         '2015-04-15 12:00:00+0300'
     )
     assert out['ignored1'] == 'just a string'
     assert out['ignored2'] == 123
Пример #2
0
 def test_attrs_from_server(self):
     values = {'tags': 'foo,bar',
               'timestamp': '2015-04-15 12:00:00+0300',
               'ignored1': 'just a string',
               'ignored2': 123}
     out = utils.attrs_from_server(values)
     assert out['tags'] == ['foo', 'bar']
     assert out['timestamp'] == iso8601.parse_date(
         '2015-04-15 12:00:00+0300'
     )
     assert out['ignored1'] == 'just a string'
     assert out['ignored2'] == 123
Пример #3
0
 def from_server(cls, values):
     return attrs_from_server(values)
Пример #4
0
 def from_server(cls, values):
     return attrs_from_server(values)