Exemplo n.º 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))
Exemplo n.º 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")
Exemplo n.º 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))
Exemplo n.º 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))
Exemplo n.º 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))
Exemplo n.º 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)
Exemplo n.º 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))
Exemplo n.º 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)
Exemplo n.º 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))
Exemplo n.º 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")
Exemplo n.º 11
0
 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.")
Exemplo n.º 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")
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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")
Exemplo n.º 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")
Exemplo n.º 17
0
 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)
Exemplo n.º 18
0
 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)
Exemplo n.º 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.")
Exemplo n.º 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.")
Exemplo n.º 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")
Exemplo n.º 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)")
Exemplo n.º 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.")
Exemplo n.º 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")
Exemplo n.º 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")
Exemplo n.º 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.")
Exemplo n.º 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")
Exemplo n.º 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)")
Exemplo n.º 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")
Exemplo n.º 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.")
Exemplo n.º 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')
Exemplo n.º 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)")
Exemplo n.º 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")
Exemplo n.º 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)")
Exemplo n.º 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")
Exemplo n.º 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.")
Exemplo n.º 37
0
    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)
Exemplo n.º 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")
Exemplo n.º 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")
Exemplo n.º 40
0
 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")
Exemplo n.º 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")
Exemplo n.º 42
0
 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")
Exemplo n.º 43
0
 def test_version(self):
     retval, output = execute_coala(coala_json.main, 'coala-json', '-v')
     self.assertEquals(retval, 0)
     self.assertNotIn("{", output)
Exemplo n.º 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)
Exemplo n.º 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")
Exemplo 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)
Exemplo n.º 47
0
 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.")
Exemplo n.º 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")
Exemplo n.º 49
0
 def test_version(self):
     with self.assertRaises(SystemExit):
         execute_coala(coala_json.main, "coala-json", "-v")
Exemplo n.º 50
0
 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")
Exemplo 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)
Exemplo n.º 52
0
 def test_version(self):
     with self.assertRaises(SystemExit):
         execute_coala(coala_json.main, 'coala-json', '-v')
Exemplo n.º 53
0
 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")
Exemplo n.º 54
0
 def test_version(self):
     retval, output = execute_coala(coala_json.main, 'coala-json', '-v')
     self.assertEquals(retval, 0)
     self.assertNotIn("{", output)