def test_properties_when_no_arguments_provided(self):
        sys.argv = ["analyze_series"]
        cmd = AnalyzeSeriesCommand()

        self.assertIsNotNone(cmd._argument_parser)
        cmd._parse_options()

        self.assertEquals(sys.stdin, cmd._input_file)
        self.assertFalse(cmd._verbose)
Пример #2
0
    def test_properties_when_no_arguments_provided(self):
        sys.argv = ["analyze_series"]
        cmd = AnalyzeSeriesCommand()

        self.assertIsNotNone(cmd._argument_parser)
        cmd._parse_options()

        self.assertEquals(sys.stdin, cmd._input_file)
        self.assertFalse(cmd._verbose)
Пример #3
0
    def test_properties_when_arguments_provided(self):
        tf = tempfile.NamedTemporaryFile(mode="r")

        sys.argv = ["analyze_series", tf.name]

        verbosity = random_bool()
        if verbosity:
            sys.argv.append("--verbose")

        assert_last_point_in_control = random_bool()
        if assert_last_point_in_control:
            sys.argv.append("--assert-last-point-in-control")

        cmd = AnalyzeSeriesCommand()

        cmd._parse_options()

        self.assertEquals(tf.name, cmd._input_file.name)
        self.assertEquals(verbosity, cmd._verbose)
        self.assertEquals(assert_last_point_in_control, cmd._assert_last_point_in_control)
    def test_properties_when_arguments_provided(self):
        tf = tempfile.NamedTemporaryFile(mode="r")

        sys.argv = ["analyze_series", tf.name]

        verbosity = random_bool()
        if verbosity:
            sys.argv.append("--verbose")

        assert_last_point_in_control = random_bool()
        if assert_last_point_in_control:
            sys.argv.append("--assert-last-point-in-control")

        cmd = AnalyzeSeriesCommand()

        cmd._parse_options()

        self.assertEquals(tf.name, cmd._input_file.name)
        self.assertEquals(verbosity, cmd._verbose)
        self.assertEquals(assert_last_point_in_control,
                          cmd._assert_last_point_in_control)