self.assertEqual(lr.get_lsb_information(),supposed_output)
os.environ.pop('LSB_ETC_LSB_RELEASE')
- @unittest.skip('Test not implemented.')
def test_get_distro_information(self):
- raise NotImplementedError()
+ # Test that an inexistant /etc/lsb-release leads to empty output
+ supposed_output = get_arch_distinfo()
+ supposed_output['RELEASE'] = 'testing/unstable';
+ supposed_output['DESCRIPTION'] = '%(ID)s %(OS)s %(RELEASE)s' % supposed_output
+
+ os.environ['LSB_ETC_LSB_RELEASE'] = 'test/inexistant_file_' + rnd_string(2,5)
+ fn = 'test/debian_version_' + rnd_string(5,12)
+ f = open(fn,'w')
+ f.write('testing/sid')
+ f.close()
+ os.environ['LSB_ETC_DEBIAN_VERSION'] = fn
+ self.assertEqual(lr.get_distro_information(),supposed_output)
+ os.remove(fn)
+ os.environ.pop('LSB_ETC_DEBIAN_VERSION')
if __name__ == '__main__':
unittest.main()