Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_does_not_exist(self):
result = detect_os("osrf/ros:does_not_exist")
self.assertEqual(result, None)
def test_fedora(self):
result = detect_os("fedora:29")
self.assertEqual(result[0], 'Fedora')
self.assertEqual(result[1], '29')
def test_ubuntu(self):
result = detect_os("ubuntu:xenial")
self.assertEqual(result[0], 'Ubuntu')
self.assertEqual(result[1], '16.04')
result = detect_os("ubuntu:bionic")
self.assertEqual(result[0], 'Ubuntu')
self.assertEqual(result[1], '18.04')
# Cover verbose codepath
result = detect_os("ubuntu:bionic", output_callback=print)
self.assertEqual(result[0], 'Ubuntu')
self.assertEqual(result[1], '18.04')
def test_ubuntu(self):
result = detect_os("ubuntu:xenial")
self.assertEqual(result[0], 'Ubuntu')
self.assertEqual(result[1], '16.04')
result = detect_os("ubuntu:bionic")
self.assertEqual(result[0], 'Ubuntu')
self.assertEqual(result[1], '18.04')
# Cover verbose codepath
result = detect_os("ubuntu:bionic", output_callback=print)
self.assertEqual(result[0], 'Ubuntu')
self.assertEqual(result[1], '18.04')
def test_ubuntu(self):
result = detect_os("ubuntu:xenial")
self.assertEqual(result[0], 'Ubuntu')
self.assertEqual(result[1], '16.04')
result = detect_os("ubuntu:bionic")
self.assertEqual(result[0], 'Ubuntu')
self.assertEqual(result[1], '18.04')
# Cover verbose codepath
result = detect_os("ubuntu:bionic", output_callback=print)
self.assertEqual(result[0], 'Ubuntu')
self.assertEqual(result[1], '18.04')