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