예제 #1
0
 def test_tagging(self):
     with bear_test_module(), prepare_file(["\t#include <a>"], None) as (lines, filename):
         log_printer = LogPrinter(NullPrinter())
         execute_coala(
             coala_ci.main,
             "coala-ci",
             "default",
             "-c",
             self.coafile,
             "-f",
             re.escape(filename),
             "-b",
             "SpaceConsistencyTestBear",
             "-S",
             "tag=test_tag",
         )
         tag_path = get_tag_path("test_tag", self.unescaped_coafile, log_printer)
         self.assertTrue(os.path.exists(tag_path))
         execute_coala(
             coala_ci.main,
             "coala-ci",
             "default",
             "-c",
             self.coafile,
             "-f",
             re.escape(filename),
             "-b",
             "SpaceConsistencyTestBear",
             "-S",
             "dtag=test_tag",
         )
         self.assertFalse(os.path.exists(tag_path))
예제 #2
0
    def test_output_file(self):
        with prepare_file(["#todo this is todo"], None) as (lines, filename):
            retval, output = execute_coala(
                coala_json.main, "coala-json", "-c", os.devnull, "-b", "LineCountTestBear", "-f", re.escape(filename)
            )
            exp_retval, exp_output = execute_coala(
                coala_json.main,
                "coala-json",
                "-c",
                os.devnull,
                "-b",
                "LineCountTestBear",
                "-f",
                re.escape(filename),
                "-o",
                "file.json",
            )

        with open("file.json") as fp:
            data = json.load(fp)

        output = json.loads(output)

        self.assertEqual(data["logs"][0]["log_level"], output["logs"][0]["log_level"])
        os.remove("file.json")
예제 #3
0
 def test_tagging(self):
     execute_coala(coala_ci.main, "coala-ci", 'docs',
                   "-S", "tag=test_tag", "-c", self.coafile)
     tag_path = get_tag_path("test_tag", self.unescaped_coafile)
     self.assertTrue(os.path.exists(tag_path))
     execute_coala(coala_ci.main, "coala-ci", 'docs',
                   "-S", "dtag=test_tag", "-c", self.coafile)
     self.assertFalse(os.path.exists(tag_path))
예제 #4
0
 def test_tagging(self):
     execute_coala(coala_ci.main, "coala-ci", 'docs',
                   "-S", "tag=test_tag", "-c", self.coafile)
     tag_path = get_tag_path("test_tag", self.unescaped_coafile)
     self.assertTrue(os.path.exists(tag_path))
     execute_coala(coala_ci.main, "coala-ci", 'docs',
                   "-S", "dtag=test_tag", "-c", self.coafile)
     self.assertFalse(os.path.exists(tag_path))
예제 #5
0
 def test_coala_delete_orig(self):
     with TemporaryDirectory() as tempdir, NamedTemporaryFile(
         suffix=".orig", dir=tempdir, delete=False
     ) as orig_file, make_temp(suffix=".coafile", prefix="", dir=tempdir) as coafile, make_temp(
         dir=tempdir
     ) as unrelated_file:
         orig_file.close()
         execute_coala(coala_ci.main, "coala-ci", "-c", re.escape(coafile))
         self.assertFalse(os.path.isfile(orig_file.name))
         self.assertTrue(os.path.isfile(unrelated_file))
예제 #6
0
    def test_show_bears(self):
        retval, output = execute_coala(coala.main, "coala", "-A")
        self.assertEqual(retval, 0)
        bear_lines = [i.startswith(" * ") for i in output.split()]
        self.assertGreater(len(bear_lines), 0)

        retval, output = execute_coala(coala.main, "coala", "-B", "-b",
                                       "LineCountBear", "-c", os.devnull)
        self.assertEqual(retval, 0)
        self.assertIn(LineCountBear.run.__doc__.strip(), output)
예제 #7
0
 def test_coala_delete_orig(self):
     with TemporaryDirectory() as tempdir,\
          NamedTemporaryFile(suffix='.orig',
                             dir=tempdir,
                             delete=False) as orig_file,\
          make_temp(suffix='.coafile', prefix='', dir=tempdir) as coafile,\
          make_temp(dir=tempdir) as unrelated_file:
         orig_file.close()
         execute_coala(coala_ci.main, "coala-ci", "-c", re.escape(coafile))
         self.assertFalse(os.path.isfile(orig_file.name))
         self.assertTrue(os.path.isfile(unrelated_file))
예제 #8
0
    def test_show_bears(self):
        retval, output = execute_coala(coala.main, "coala", "-A")
        self.assertEqual(retval, 0)
        bear_lines = [i.startswith(" * ") for i in output.split()]
        self.assertGreater(len(bear_lines), 0)

        retval, output = execute_coala(coala.main, "coala", "-B",
                                       "-b", "LineCountBear",
                                       "-c", os.devnull)
        self.assertEqual(retval, 0)
        self.assertIn(LineCountBear.run.__doc__.strip(), output)
예제 #9
0
 def test_tagging(self):
     with bear_test_module(), \
             prepare_file(["\t#include <a>"], None) as (lines, filename):
         log_printer = LogPrinter(NullPrinter())
         execute_coala(coala_ci.main, "coala-ci", "default", "-c",
                       self.coafile, "-f", re.escape(filename), "-b",
                       "SpaceConsistencyTestBear", "-S", "tag=test_tag")
         tag_path = get_tag_path("test_tag", self.unescaped_coafile,
                                 log_printer)
         self.assertTrue(os.path.exists(tag_path))
         execute_coala(coala_ci.main, "coala-ci", "default", "-c",
                       self.coafile, "-f", re.escape(filename), "-b",
                       "SpaceConsistencyTestBear", "-S", "dtag=test_tag")
         self.assertFalse(os.path.exists(tag_path))
예제 #10
0
 def test_find_issues(self):
     with bear_test_module(), prepare_file(["#fixme"], None) as (lines, filename):
         retval, output = execute_coala(
             coala_ci.main, "coala-ci", "-c", os.devnull, "-b", "LineCountTestBear", "-f", re.escape(filename)
         )
         self.assertIn("This file has 1 lines.", output, "The output should report count as 1 lines")
         self.assertNotEqual(retval, 0, "coala-ci was expected to return non-zero")
예제 #11
0
파일: coalaJSONTest.py 프로젝트: 707/coala
 def test_nonexistent(self):
     retval, output = execute_coala(
         coala_json.main, "coala-json", "-c", 'nonex', "test")
     output = json.loads(output)
     self.assertRegex(
         output["logs"][0]["message"],
         "The requested coafile '.*' does not exist.")
예제 #12
0
 def test_find_issues(self):
     with bear_test_module(), prepare_file(["#fixme"], None) as (lines, filename):
         retval, output = execute_coala(
             coala_json.main, "coala-json", "-c", os.devnull, "-b", "LineCountTestBear", "-f", re.escape(filename)
         )
         output = json.loads(output)
         self.assertEqual(output["results"]["default"][0]["message"], "This file has 1 lines.")
         self.assertNotEqual(retval, 0, "coala-json must return nonzero when " "results found")
예제 #13
0
 def test_fail_acquire_settings(self):
     retval, output = execute_coala(coala_ci.main,
                                    "coala-ci",
                                    "-b",
                                    'SpaceConsistencyBear',
                                    '-c',
                                    os.devnull)
     self.assertIn("During execution, we found that some", output)
예제 #14
0
 def test_fail_acquire_settings(self):
     retval, output = execute_coala(coala_ci.main,
                                    "coala-ci",
                                    "-b",
                                    'SpaceConsistencyBear',
                                    '-c',
                                    os.devnull)
     self.assertIn("During execution, we found that some", output)
예제 #15
0
 def test_coala(self):
     with prepare_file(["#fixme"], None) as (lines, filename):
         bear = "LineCountBear"
         retval, output = execute_coala(coala.main, "coala", "-c",
                                        os.devnull, "--settings",
                                        "files=" + re.escape(filename),
                                        "bears=" + bear)
     self.assertIn("This file has 1 lines.", output,
                   "The output should report count as 1 lines")
예제 #16
0
 def test_coala(self):
     with bear_test_module(), \
             prepare_file(["#fixme"], None) as (lines, filename):
         retval, output = execute_coala(coala.main, "coala",
                                        "-c", os.devnull, "-f",
                                        re.escape(filename), "-b",
                                        "LineCountTestBear")
         self.assertIn("This file has 1 lines.", output,
                       "The output should report count as 1 lines")
예제 #17
0
파일: coalaJSONTest.py 프로젝트: 707/coala
 def test_fail_acquire_settings(self):
     retval, output = execute_coala(coala_json.main, 'coala-json', '-b',
                                    'SpaceConsistencyBear', '-c',
                                    os.devnull)
     output = json.loads(output)
     found = False
     for msg in output["logs"]:
         if "During execution, we found that some" in msg["message"]:
             found = True
     self.assertTrue(found)
예제 #18
0
파일: coalaJSONTest.py 프로젝트: 707/coala
 def test_fail_acquire_settings(self):
     retval, output = execute_coala(
         coala_json.main, 'coala-json', '-b',
         'SpaceConsistencyBear', '-c', os.devnull)
     output = json.loads(output)
     found = False
     for msg in output["logs"]:
         if "During execution, we found that some" in msg["message"]:
             found = True
     self.assertTrue(found)
예제 #19
0
 def test_find_no_issues(self):
     retval, output = execute_coala(coala_ci.main, "coala-ci", 'docs', '-c',
                                    self.coafile)
     self.assertRegex(
         output, "(.*Unable to collect bears from.*PyLintBear.*)?",
         "coala-ci output should be empty when running "
         "over its own code.")
     self.assertEqual(
         retval, 0, "coala-ci must return zero when running over its "
         "own code.")
예제 #20
0
 def test_fix_patchable_issues(self):
     with prepare_file(["    #include <a>"], None) as (lines, filename):
         bear = "IndentBear"
         retval, output = execute_coala(
             coala_ci.main, "coala-ci", "-c", os.devnull, "--settings",
             "files=" + filename, "bears=" + bear, "autoapply=true",
             "default_actions=" + bear + ":ApplyPatchAction")
         self.assertEqual(
             retval, 5, "coala-ci must return exitcode 5 when it "
             "autofixes the code.")
예제 #21
0
 def test_fail_acquire_settings(self):
     with bear_test_module():
         retval, output = execute_coala(
             coala_json.main, "coala-json", "-c", os.devnull, "-b", "SpaceConsistencyTestBear"
         )
         output = json.loads(output)
         found = False
         for msg in output["logs"]:
             if "During execution, we found that some" in msg["message"]:
                 found = True
         self.assertTrue(found, "Missing settings not logged")
예제 #22
0
 def test_find_issues(self):
     retval, output = execute_coala(
         coala_ci.main, "coala-ci", "todos", "-c", self.coafile)
     self.assertRegex(output,
                      r'The line contains the keyword `# \w+`.',
                      "coala-ci output should be empty when running "
                      "over its own code. (Target section: todos)")
     self.assertNotEqual(retval,
                         0,
                         "coala-ci must return nonzero when running over "
                         "its own code. (Target section: todos)")
예제 #23
0
 def test_find_no_issues(self):
     retval, output = execute_coala(
         coala_ci.main, "coala-ci", 'docs', '-c', self.coafile)
     self.assertRegex(output,
                      "(.*Unable to collect bears from.*PyLintBear.*)?",
                      "coala-ci output should be empty when running "
                      "over its own code.")
     self.assertEqual(retval,
                      0,
                      "coala-ci must return zero when running over its "
                      "own code.")
예제 #24
0
 def test_find_no_issues(self):
     with bear_test_module(), \
             prepare_file(["#include <a>"], None) as (lines, filename):
         retval, output = execute_coala(coala_ci.main, "coala-ci",
                                        '-c', os.devnull, '-f',
                                        re.escape(filename), '-b',
                                        'SpaceConsistencyTestBear',
                                        "--settings", "use_spaces=True")
         self.assertIn("Executing section Default", output)
         self.assertEqual(retval, 0,
                          "coala-ci must return zero when successful")
예제 #25
0
 def test_coala(self):
     with bear_test_module(), \
             prepare_file(["#fixme"], None) as (lines, filename):
         retval, output = execute_coala(
                          coala.main,
                         "coala", "-c", os.devnull,
                         "-f", re.escape(filename),
                         "-b", "LineCountTestBear")
         self.assertIn("This file has 1 lines.",
                       output,
                       "The output should report count as 1 lines")
예제 #26
0
 def test_fix_patchable_issues(self):
     with prepare_file(["    #include <a>"], None) as (lines, filename):
         bear = "IndentBear"
         retval, output = execute_coala(
             coala_ci.main, "coala-ci", "-c", os.devnull, "--settings",
             "files=" + filename, "bears=" + bear, "autoapply=true",
             "default_actions=" + bear + ":ApplyPatchAction")
         self.assertEqual(retval,
                          5,
                          "coala-ci must return exitcode 5 when it "
                          "autofixes the code.")
예제 #27
0
 def test_find_issues(self):
     with bear_test_module(), \
             prepare_file(["#fixme"], None) as (lines, filename):
         retval, output = execute_coala(coala_ci.main, "coala-ci", "-c",
                                        os.devnull, "-b",
                                        "LineCountTestBear", "-f",
                                        re.escape(filename))
         self.assertIn("This file has 1 lines.", output,
                       "The output should report count as 1 lines")
         self.assertNotEqual(retval, 0,
                             "coala-ci was expected to return non-zero")
예제 #28
0
 def test_find_issues(self):
     retval, output = execute_coala(
         coala_ci.main, "coala-ci", "todos", "-c", self.coafile)
     self.assertRegex(output,
                      r'The line contains the keyword `# \w+`.',
                      "coala-ci output should be empty when running "
                      "over its own code. (Target section: todos)")
     self.assertNotEqual(retval,
                         0,
                         "coala-ci must return nonzero when running over "
                         "its own code. (Target section: todos)")
예제 #29
0
 def test_coala(self):
     with prepare_file(["#fixme"], None) as (lines, filename):
         bear = "LineCountBear"
         retval, output = execute_coala(
                          coala.main,
                         "coala", "-c", os.devnull,
                         "--settings", "files=" + re.escape(filename),
                         "bears=" + bear)
     self.assertIn("This file has 1 lines.",
                   output,
                   "The output should report count as 1 lines")
예제 #30
0
 def test_fix_patchable_issues(self):
     with bear_test_module(), \
             prepare_file(["\t#include <a>"], None) as (lines, filename):
         retval, output = execute_coala(
             coala_ci.main, "coala-ci", "-c", os.devnull, "-f",
             re.escape(filename), "-b", "SpaceConsistencyTestBear",
             "--settings", "autoapply=true", "use_spaces=True",
             "default_actions=SpaceConsistencyTestBear:ApplyPatchAction")
         self.assertIn("Applied 'ApplyPatchAction'", output)
         self.assertEqual(
             retval, 5, "coala-ci must return exitcode 5 when it "
             "autofixes the code.")
예제 #31
0
    def test_output_file(self):
        with prepare_file(["#todo this is todo"], None) as (lines, filename):
            retval, output = execute_coala(coala_json.main, "coala-json", "-c",
                                           os.devnull, "-b",
                                           "LineCountTestBear", "-f",
                                           re.escape(filename))
            exp_retval, exp_output = execute_coala(coala_json.main,
                                                   "coala-json", "-c",
                                                   os.devnull, "-b",
                                                   "LineCountTestBear", "-f",
                                                   re.escape(filename), "-o",
                                                   "file.json")

        with open('file.json') as fp:
            data = json.load(fp)

        output = json.loads(output)

        self.assertEqual(data['logs'][0]['log_level'],
                         output['logs'][0]['log_level'])
        os.remove('file.json')
예제 #32
0
 def test_find_issues(self):
     retval, output = execute_coala(coala_json.main, "coala-json", "todos",
                                    "-c", self.coafile)
     output = json.loads(output)
     self.assertRegex(
         output["results"]["todos"][0]["message"],
         r'The line contains the keyword `# \w+`.',
         "coala-json output should be empty when running "
         "over its own code. (Target section: todos)")
     self.assertNotEqual(
         retval, 0, "coala-json must return nonzero when running over "
         "its own code. (Target section: todos)")
예제 #33
0
 def test_find_issues(self):
     with bear_test_module(), \
             prepare_file(["#fixme"], None) as (lines, filename):
         retval, output = execute_coala(coala_json.main, "coala-json", "-c",
                                        os.devnull, "-b",
                                        "LineCountTestBear", "-f",
                                        re.escape(filename))
         output = json.loads(output)
         self.assertEqual(output["results"]["default"][0]["message"],
                          "This file has 1 lines.")
         self.assertNotEqual(
             retval, 0, "coala-json must return nonzero when "
             "results found")
예제 #34
0
 def test_find_issues(self):
     retval, output = execute_coala(
         coala_json.main, "coala-json", "todos", "-c",
         self.coafile)
     output = json.loads(output)
     self.assertRegex(output["results"]["todos"][0]["message"],
                      r'The line contains the keyword `# \w+`.',
                      "coala-json output should be empty when running "
                      "over its own code. (Target section: todos)")
     self.assertNotEqual(retval,
                         0,
                         "coala-json must return nonzero when running over "
                         "its own code. (Target section: todos)")
예제 #35
0
 def test_line_count(self):
     with bear_test_module(), \
             prepare_file(["#fixme"], None) as (lines, filename):
         retval, output = execute_coala(coala_format.main, "coala-format",
                                        "-c", os.devnull,
                                        "-f", re.escape(filename),
                                        "-b", "LineCountTestBear")
         self.assertRegex(output, r'msg:This file has [0-9]+ lines.',
                          "coala-format output for line count should "
                          "not be empty")
         self.assertEqual(retval, 1,
                          "coala-format must return exitcode 1 when it "
                          "yields results")
예제 #36
0
 def test_fix_patchable_issues(self):
     with bear_test_module(), \
             prepare_file(["\t#include <a>"], None) as (lines, filename):
         retval, output = execute_coala(
             coala_ci.main, "coala-ci",
             "-c", os.devnull,
             "-f", re.escape(filename),
             "-b", "SpaceConsistencyTestBear",
             "--settings", "autoapply=true", "use_spaces=True",
             "default_actions=SpaceConsistencyTestBear:ApplyPatchAction")
         self.assertIn("Applied 'ApplyPatchAction'", output)
         self.assertEqual(retval, 5,
                          "coala-ci must return exitcode 5 when it "
                          "autofixes the code.")
예제 #37
0
파일: coalaTest.py 프로젝트: sam09/coala
    def test_show_bears(self):
        retval, output = execute_coala(coala.main, "coala", "-A")
        self.assertEqual(retval, 0)
        lines = output.splitlines()
        bear_missing_lines = sum(1 for line in lines if "WARNING" in line)
        self.assertEqual(bear_missing_lines, 0)

        with bear_test_module():
            retval, output = execute_coala(coala.main, "coala", "-A")
            self.assertEqual(retval, 0)

            lines = output.splitlines()
            bear_lines = sum(1 for line in lines if line.startswith(" * "))
            self.assertEqual(bear_lines, 2)

            for line in lines:
                self.assertNotIn("WARNING", line)

            retval, output = execute_coala(
                coala.main, "coala", "-B",
                "-b", "LineCountTestBear, SpaceConsistencyTestBear",
                "-c", os.devnull)
            self.assertEqual(retval, 0)
            self.assertIn(LineCountTestBear.run.__doc__.strip(), output)
예제 #38
0
 def test_find_issues(self):
     with prepare_file(["#todo this is todo"], None) as (lines, filename):
         bear = "KeywordBear"
         retval, output = execute_coala(coala_ci.main, "coala-ci", "-c",
                                        os.devnull, "-S",
                                        "ci_keywords=#TODO",
                                        "cs_keywords=#todo",
                                        "bears=" + bear,
                                        "-f", re.escape(filename))
         self.assertIn("The line contains the keyword `#todo`.",
                       output, "coala-ci output should match the keyword\
                       #todo")
         self.assertNotEqual(retval,
                             0, "coala-ci must return nonzero when "
                             "matching `#todo` keyword")
예제 #39
0
 def test_find_no_issues(self):
     with bear_test_module(), prepare_file(["#include <a>"], None) as (lines, filename):
         retval, output = execute_coala(
             coala_ci.main,
             "coala-ci",
             "-c",
             os.devnull,
             "-f",
             re.escape(filename),
             "-b",
             "SpaceConsistencyTestBear",
             "--settings",
             "use_spaces=True",
         )
         self.assertIn("Executing section Default", output)
         self.assertEqual(retval, 0, "coala-ci must return zero when successful")
예제 #40
0
파일: coalaJSONTest.py 프로젝트: 707/coala
 def test_find_issues(self):
     with prepare_file(["#todo this is todo"], None) as (lines, filename):
         bear = "KeywordBear"
         retval, output = execute_coala(coala_json.main, "coala-json", "-c",
                                        os.devnull, "-S",
                                        "ci_keywords=#TODO",
                                        "cs_keywords=#todo",
                                        "bears=" + bear,
                                        "-f", re.escape(filename))
         output = json.loads(output)
         self.assertEqual(output["results"]["default"][0]["message"],
                          "The line contains the keyword `#todo`.",
                          "coala-json output should match the keyword #todo")
         self.assertNotEqual(retval,
                             0, "coala-json must return nonzero when "
                             "matching `#todo` keyword")
예제 #41
0
 def test_find_issues(self):
     with prepare_file(["#todo this is todo"], None) as (lines, filename):
         bear = "KeywordBear"
         retval, output = execute_coala(coala_ci.main, "coala-ci", "-c",
                                        os.devnull, "-S",
                                        "ci_keywords=#TODO",
                                        "cs_keywords=#todo",
                                        "bears=" + bear, "-f",
                                        re.escape(filename))
         self.assertIn(
             "The line contains the keyword `#todo`.", output,
             "coala-ci output should match the keyword\
                       #todo")
         self.assertNotEqual(
             retval, 0, "coala-ci must return nonzero when "
             "matching `#todo` keyword")
예제 #42
0
파일: coalaJSONTest.py 프로젝트: 707/coala
 def test_find_issues(self):
     with prepare_file(["#todo this is todo"], None) as (lines, filename):
         bear = "KeywordBear"
         retval, output = execute_coala(coala_json.main, "coala-json", "-c",
                                        os.devnull, "-S",
                                        "ci_keywords=#TODO",
                                        "cs_keywords=#todo",
                                        "bears=" + bear, "-f",
                                        re.escape(filename))
         output = json.loads(output)
         self.assertEqual(
             output["results"]["default"][0]["message"],
             "The line contains the keyword `#todo`.",
             "coala-json output should match the keyword #todo")
         self.assertNotEqual(
             retval, 0, "coala-json must return nonzero when "
             "matching `#todo` keyword")
예제 #43
0
파일: coalaJSONTest.py 프로젝트: 707/coala
 def test_version(self):
     retval, output = execute_coala(coala_json.main, 'coala-json', '-v')
     self.assertEquals(retval, 0)
     self.assertNotIn("{", output)
예제 #44
0
 def test_did_nothing(self):
     retval, output = execute_coala(coala.main, "coala", "-c", os.devnull,
                                    "-S", "default.enabled=false")
     self.assertEqual(retval, 0)
     self.assertIn("No existent section was targeted or enabled", output)
예제 #45
0
 def test_nonexistent(self):
     retval, output = execute_coala(
         coala_ci.main, "coala-ci", "-c", 'nonex', "test")
     self.assertRegex(
         output,
         ".*\\[ERROR\\].*The requested coafile '.*' does not exist.\n")
예제 #46
0
 def test_fail_acquire_settings(self):
     with bear_test_module():
         retval, output = execute_coala(
             coala_ci.main, "coala-ci", "-b", "SpaceConsistencyTestBear", "-c", os.devnull
         )
         self.assertIn("During execution, we found that some", output)
예제 #47
0
파일: coalaJSONTest.py 프로젝트: 707/coala
 def test_nonexistent(self):
     retval, output = execute_coala(coala_json.main, "coala-json", "-c",
                                    'nonex', "test")
     output = json.loads(output)
     self.assertRegex(output["logs"][0]["message"],
                      "The requested coafile '.*' does not exist.")
예제 #48
0
 def test_nonexistent(self):
     retval, output = execute_coala(coala_ci.main, "coala-ci", "-c",
                                    'nonex', "test")
     self.assertRegex(
         output,
         ".*\\[ERROR\\].*The requested coafile '.*' does not exist.\n")
예제 #49
0
 def test_version(self):
     with self.assertRaises(SystemExit):
         execute_coala(coala_json.main, "coala-json", "-v")
예제 #50
0
파일: coalaJSONTest.py 프로젝트: 707/coala
 def test_text_logs(self):
     retval, output = execute_coala(coala_json.main, 'coala-json',
                                    '--text-logs', '-c', 'nonex')
     self.assertRegex(
         output,
         ".*\\[ERROR\\].*The requested coafile '.*' does not exist.\n")
예제 #51
0
 def test_did_nothing(self):
     retval, output = execute_coala(coala.main, "coala", "-c", os.devnull,
                                    "-S", "default.enabled=false")
     self.assertEqual(retval, 0)
     self.assertIn("No existent section was targeted or enabled", output)
예제 #52
0
 def test_version(self):
     with self.assertRaises(SystemExit):
         execute_coala(coala_json.main, 'coala-json', '-v')
예제 #53
0
파일: coalaJSONTest.py 프로젝트: 707/coala
 def test_text_logs(self):
     retval, output = execute_coala(
         coala_json.main, 'coala-json', '--text-logs', '-c', 'nonex')
     self.assertRegex(
         output,
         ".*\\[ERROR\\].*The requested coafile '.*' does not exist.\n")
예제 #54
0
파일: coalaJSONTest.py 프로젝트: 707/coala
 def test_version(self):
     retval, output = execute_coala(coala_json.main, 'coala-json', '-v')
     self.assertEquals(retval, 0)
     self.assertNotIn("{", output)