Example #1
0
    def test_generates_test_stubs(self):
        expected_result = read_data("static_analysis_output.py")
        project = ProjectInDirectory(self.tmpdir)
        module_path = putfile(project.path, "module.py", read_data("static_analysis_module.py"))

        inspect_project(project)
        add_tests_to_project(project, [module_path], 'unittest')
        result = get_test_module_contents(project)

        assert_equal_strings(expected_result, result)
Example #2
0
    def test_generates_test_stubs(self):
        expected_result = read_data("static_analysis_output.py")
        project = ProjectInDirectory(self.tmpdir)
        module_path = putfile(project.path, "module.py",
                              read_data("static_analysis_module.py"))

        inspect_project(project)
        add_tests_to_project(project, [module_path], 'unittest')
        result = get_test_module_contents(project)

        assert_equal_strings(expected_result, result)
Example #3
0
    def execute_with_point_of_entry_and_assert(self, id):
        expected_result = read_data("%s_output.py" % id)
        project = ProjectInDirectory(self.tmpdir).with_points_of_entry(["poe.py"])
        module_path = putfile(project.path, "module.py", read_data("%s_module.py" % id))
        write_content_to_file(read_data("generic_acceptance_poe.py"), project.path_for_point_of_entry("poe.py"))

        inspect_project(project)
        add_tests_to_project(project, [module_path], 'unittest')
        result = get_test_module_contents(project)

        assert_equal_strings(expected_result, result)
Example #4
0
    def execute_with_point_of_entry_and_assert(self, id):
        expected_result = read_data("%s_output.py" % id)
        project = ProjectInDirectory(self.tmpdir).with_points_of_entry(
            ["poe.py"])
        module_path = putfile(project.path, "module.py",
                              read_data("%s_module.py" % id))
        write_content_to_file(read_data("generic_acceptance_poe.py"),
                              project.path_for_point_of_entry("poe.py"))

        inspect_project(project)
        add_tests_to_project(project, [module_path], 'unittest')
        result = get_test_module_contents(project)

        assert_equal_strings(expected_result, result)