Exemplo n.º 1
0
 def test_multiple_csv_expands_in_dict(self):
     result = api.parse_tags(
         'ceph.osd_something=1,ceph.foo=2,ceph.fsid=0000')
     # assert them piecemeal to avoid the un-ordered dict nature
     assert result['ceph.osd_something'] == '1'
     assert result['ceph.foo'] == '2'
     assert result['ceph.fsid'] == '0000'
Exemplo n.º 2
0
 def test_no_tags_means_empty_dict(self):
     result = api.parse_tags('')
     assert result == {}
Exemplo n.º 3
0
 def test_mixed_non_ceph_tags(self):
     result = api.parse_tags('foo,ceph.bar=1')
     assert result == {'ceph.bar': '1'}
Exemplo n.º 4
0
 def test_single_tag_gets_parsed(self):
     result = api.parse_tags('ceph.osd_something=1')
     assert result == {'ceph.osd_something': '1'}
Exemplo n.º 5
0
 def test_non_ceph_tags_are_skipped(self):
     result = api.parse_tags('foo')
     assert result == {}
Exemplo n.º 6
0
 def test_no_tags_means_empty_dict(self):
     result = api.parse_tags('')
     assert result == {}
Exemplo n.º 7
0
 def test_multiple_csv_expands_in_dict(self):
     result = api.parse_tags('ceph.osd_something=1,ceph.foo=2,ceph.fsid=0000')
     # assert them piecemeal to avoid the un-ordered dict nature
     assert result['ceph.osd_something'] == '1'
     assert result['ceph.foo'] == '2'
     assert result['ceph.fsid'] == '0000'
Exemplo n.º 8
0
 def test_mixed_non_ceph_tags(self):
     result = api.parse_tags('foo,ceph.bar=1')
     assert result == {'ceph.bar': '1'}
Exemplo n.º 9
0
 def test_non_ceph_tags_are_skipped(self):
     result = api.parse_tags('foo')
     assert result == {}
Exemplo n.º 10
0
 def test_single_tag_gets_parsed(self):
     result = api.parse_tags('ceph.osd_something=1')
     assert result == {'ceph.osd_something': '1'}