Esempio n. 1
0
 def test_does_not_get_poluted_with_non_lv_items(self, monkeypatch):
     report = '{"report":[{"lv":[{"lv_name":"VolName"}],"vg":[{"vg":"1"}]}]}'
     monkeypatch.setattr(api.process, 'call', lambda x: (report, '', 0))
     assert api.get_api_lvs() == [{'lv_name': 'VolName'}]
Esempio n. 2
0
 def test_report_has_stuff(self, monkeypatch):
     report = '{"report":[{"lv":[{"lv_name":"VolGroup00"}]}]}'
     monkeypatch.setattr(api.process, 'call', lambda x: (report, '', 0))
     assert api.get_api_lvs() == [{'lv_name': 'VolGroup00'}]
Esempio n. 3
0
 def test_report_has_multiple_items(self, monkeypatch):
     report = '{"report":[{"lv":[{"lv_name":"VolName"},{"lv_name":"ceph_lv"}]}]}'
     monkeypatch.setattr(api.process, 'call', lambda x: (report, '', 0))
     assert api.get_api_lvs() == [{'lv_name': 'VolName'}, {'lv_name': 'ceph_lv'}]
Esempio n. 4
0
 def test_report_is_emtpy(self, monkeypatch):
     monkeypatch.setattr(api.process, 'call', lambda x: ('{}', '', 0))
     assert api.get_api_lvs() == []
Esempio n. 5
0
 def test_report_has_multiple_items(self, monkeypatch):
     report = ['  ;/path;VolName;root', ';/dev/path;ceph_lv;ceph_vg']
     monkeypatch.setattr(api.process, 'call', lambda x: (report, '', 0))
     result = api.get_api_lvs()
     assert result[0]['lv_name'] == 'VolName'
     assert result[1]['lv_name'] == 'ceph_lv'
Esempio n. 6
0
 def test_report_has_stuff(self, monkeypatch):
     report = ['  ;/path;VolGroup00;root']
     monkeypatch.setattr(api.process, 'call', lambda x: (report, '', 0))
     result = api.get_api_lvs()
     assert result[0]['lv_name'] == 'VolGroup00'
Esempio n. 7
0
 def test_report_has_multiple_items(self, monkeypatch):
     report = ['  ;/path;VolName;root', ';/dev/path;ceph_lv;ceph_vg']
     monkeypatch.setattr(api.process, 'call', lambda x: (report, '', 0))
     result = api.get_api_lvs()
     assert result[0]['lv_name'] == 'VolName'
     assert result[1]['lv_name'] == 'ceph_lv'
Esempio n. 8
0
 def test_report_has_stuff(self, monkeypatch):
     report = ['  ;/path;VolGroup00;root']
     monkeypatch.setattr(api.process, 'call', lambda x: (report, '', 0))
     result = api.get_api_lvs()
     assert result[0]['lv_name'] == 'VolGroup00'