def test_subsequent_calls_for_same_lib_name_under_different_paths_return_different_libdocs(self): parent_path = os.path.dirname(os.path.realpath(__file__)) response1 = create_libdoc("lib", [os.path.join(parent_path, 'res_test_robot_session_server', 'a')], []) response2 = create_libdoc("lib", [os.path.join(parent_path, 'res_test_robot_session_server', 'b')], []) self.assertNotEqual(response1, response2)
def test_if_sys_path_is_not_extended_after_generating_libdoc(self): parent_path = os.path.dirname(os.path.realpath(__file__)) python_paths = [os.path.join(parent_path, 'res_test_robot_session_server', 'a')] class_paths = [os.path.join(parent_path, 'res_test_robot_session_server', 'b')] old_sys_path = sorted(sys.path) create_libdoc("lib", python_paths, class_paths) self.assertEqual(old_sys_path, sorted(sys.path))
def test_subsequent_lidocs_for_same_name_libs_under_different_paths_returns_different_libdocs( self): parent_path = os.path.dirname(os.path.realpath(__file__)) libdoc1 = create_libdoc( "lib", [os.path.join(parent_path, 'res_test_robot_session_server', 'a')], []) libdoc2 = create_libdoc( "lib", [os.path.join(parent_path, 'res_test_robot_session_server', 'b')], []) self.assertNotEqual(libdoc1, libdoc2)
def test_if_libdoc_is_not_generated_and_exception_is_thrown_for_library_with_error(self): parent_path = os.path.dirname(os.path.realpath(__file__)) response = create_libdoc("LibError", 'XML', [os.path.join(parent_path, 'res_test_robot_session_server')], []) self.assertEqual(response['result'], None) self.assertTrue('SyntaxError: ' in response['exception'])
def test_if_libdoc_is_not_generated_for_non_ascii_chars_in_library_path(self): parent_path = os.path.dirname(os.path.realpath(__file__)) timeout_duration = 5 if 'Jython' not in platform.python_implementation() else 20 response = create_libdoc("żółw", 'XML', [os.path.join(parent_path, 'res_test_robot_session_server', 'żółw')], [], timeout_duration) self.assertTrue('UnicodeDecodeError', response['exception'])
def test_if_libdoc_is_generated_for_non_ascii_chars_in_library_path(self): parent_path = os.path.dirname(os.path.realpath(__file__)) response = create_libdoc("lib", 'XML', [ os.path.join(parent_path, 'res_test_robot_session_server', 'żółw') ], []) self.assertNotEqual(response['result'], None)
def test_encode_exception(self): parent_path = os.path.dirname(os.path.realpath(__file__)) response = create_libdoc( "LibError", 'XML', [os.path.join(parent_path, 'res_test_robot_session_server')], []) self.assertEqual(response['result'], None) self.assertTrue('SyntaxError: ' in response['exception'])
def test_encode_exception(self): parent_path = os.path.dirname(os.path.realpath(__file__)) response = create_libdoc( "LibError", 'XML', [os.path.join(parent_path, 'res_test_robot_session_server')], []) self.assertEqual(response['result'], None) self.assertTrue( 'Unable to generate library specification file for library: \'LibError\'' in response['exception'])
def test_encode_exception(self): response = create_libdoc() self.assertEqual(response['result'], None) self.assertTrue('TypeError: ' in response['exception'])