Exemplo n.º 1
0
 def test_help(self):
     with CapturedOutput() as output:
         with self.assertRaises(SystemExit) as cm:
             runmain(["--help"])
     self.assertEqual(cm.exception.code, 0)
     self.assertTrue("arguments" in output.std)
     self.assertEqual(output.err, "")
Exemplo n.º 2
0
 def test_version(self):
     with CapturedOutput() as output:
         with self.assertRaises(SystemExit) as cm:
             runmain(["--version"])
     self.assertEqual(cm.exception.code, 0)
     self.assertTrue(output.std.startswith("DEPZ"))
     self.assertEqual(output.err, "")
Exemplo n.º 3
0
 def test_relink_print_externals_multi_lines(self):
     with CapturedOutput() as output:
         runmain([
             "--project",
             str(self.tempDir / "project"), "--relink", "-e", "multi"
         ])
     self.assertEqual(output.std.strip(), "numpy\nrequests")
Exemplo n.º 4
0
    def test_relink_default(self):
        with CapturedOutput() as output:
            runmain(["--project", str(self.tempDir / "project"), "--relink"])

        result = listDir((self.tempDir / "project"))
        self.assertListEqual(result, self.expectedPythonAfterLink)
        self.assertTrue("Creating symlink" in output.std)
Exemplo n.º 5
0
    def test_relink_layout(self):
        runmain([
            "--project",
            str(self.tempDir / "project"), "--relink", "--mode", "layout"
        ])
        result = listDir((self.tempDir / "project"))

        self.assertListEqual(result, self.expectedAfterLink)
Exemplo n.º 6
0
 def test_relink_twice(self):
     runmain(["--project", str(self.tempDir / "project"), "--relink"])
     # removing something
     (self.tempDir / "project" / "lib2").unlink()
     # creaing links again
     with CapturedOutput() as output:
         runmain(["--project", str(self.tempDir / "project"), "--relink"])
     result = listDir((self.tempDir / "project"))
     self.assertListEqual(result, self.expectedPythonAfterLink)
     self.assertTrue("Creating symlink" in output.std)
Exemplo n.º 7
0
 def test_scan_only(self):
     os.chdir(self.tempDir / "project")
     with CapturedOutput() as output:
         runmain([])
     result = listDir((self.tempDir / "project"))
     # print("!!!!!")
     # pprint(result)
     # print(output.std)
     # print(output.err)
     self.assertListEqual(result, self.expectedUnchanged)
     self.assertTrue("Supposed mapping:" in output.std)
Exemplo n.º 8
0
 def test_project_dir_does_not_exist(self):
     with self.assertRaises(FileNotFoundError):
         runmain(["--project", "labuda"])
Exemplo n.º 9
0
 def _run_relink_current_dir(self):
     runmain(["--relink"])
     result = listDir((self.tempDir / "project"))
     self.assertListEqual(result, self.expectedPythonAfterLink)