Example #1
0
 def test_dash_as_file(self):
     args = moonpy.parse_args(["-"])
     self.assertIs(args.file, sys.stdin)
Example #2
0
    def test_dash_V(self):
        args = moonpy.parse_args(["-V"])
        self.assertIs(args.version, True)

        args = moonpy.parse_args(["--version"])
        self.assertIs(args.version, True)
Example #3
0
 def test_file_defaults_stdin(self):
     args = moonpy.parse_args([])
     self.assertIs(args.file, sys.stdin)
Example #4
0
 def test_file(self):
     args = moonpy.parse_args(["sample.py"])
     self.assertEqual(args.file, "sample.py")
Example #5
0
    def test_dash_i(self):
        args = moonpy.parse_args(["-i"])
        self.assertEqual(args.i, True)

        args = moonpy.parse_args([])
        self.assertEqual(args.i, False)
Example #6
0
 def test_dash_c(self):
     args = moonpy.parse_args(["-c", "command"])
     self.assertEqual(args.c, "command")
Example #7
0
 def test_dash_m(self):
     args = moonpy.parse_args(["-m", "module_1"])
     self.assertEqual(args.m, "module_1")