示例#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'
示例#2
0
 def test_no_tags_means_empty_dict(self):
     result = api.parse_tags('')
     assert result == {}
示例#3
0
 def test_mixed_non_ceph_tags(self):
     result = api.parse_tags('foo,ceph.bar=1')
     assert result == {'ceph.bar': '1'}
示例#4
0
 def test_single_tag_gets_parsed(self):
     result = api.parse_tags('ceph.osd_something=1')
     assert result == {'ceph.osd_something': '1'}
示例#5
0
 def test_non_ceph_tags_are_skipped(self):
     result = api.parse_tags('foo')
     assert result == {}
示例#6
0
 def test_no_tags_means_empty_dict(self):
     result = api.parse_tags('')
     assert result == {}
示例#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'
示例#8
0
 def test_mixed_non_ceph_tags(self):
     result = api.parse_tags('foo,ceph.bar=1')
     assert result == {'ceph.bar': '1'}
示例#9
0
 def test_non_ceph_tags_are_skipped(self):
     result = api.parse_tags('foo')
     assert result == {}
示例#10
0
 def test_single_tag_gets_parsed(self):
     result = api.parse_tags('ceph.osd_something=1')
     assert result == {'ceph.osd_something': '1'}