Exemple #1
0
 def test_display_single_grid(self):
     self.args.append('-g')
     self.args.append('GLOBAL_MERCATOR')
     with capture() as (out, err):
         grids_command(self.args)
     captured_output = out.getvalue()
     assert "GLOBAL_MERCATOR" in captured_output
Exemple #2
0
 def test_ignore_case(self):
     self.args.append('-g')
     self.args.append('global_geodetic')
     with capture() as (out, err):
         grids_command(self.args)
     captured_output = out.getvalue()
     assert "GLOBAL_GEODETIC" in captured_output
    def test_list_configured(self):
        self.args.append('-l')
        grids_command(self.args)
        captured_output = sys.stdout.getvalue()
        for grid in GRID_NAMES:
            assert grid in captured_output

        number_of_lines = sum(1 for line in captured_output.split('\n') if line)

        assert number_of_lines == len(GRID_NAMES)
Exemple #4
0
    def test_list_configured_all(self):
        self.args.append("-l")
        self.args.append("--all")
        grids_command(self.args)
        captured_output = sys.stdout.getvalue()
        for grid in GRID_NAMES + UNUSED_GRID_NAMES:
            assert grid in captured_output

        number_of_lines = sum(1 for line in captured_output.split("\n") if line)

        assert number_of_lines == len(UNUSED_GRID_NAMES) + len(GRID_NAMES)
Exemple #5
0
    def test_list_configured(self):
        self.args.append('-l')
        with capture() as (out, err):
            grids_command(self.args)
        captured_output = out.getvalue()
        for grid in GRID_NAMES:
            assert grid in captured_output

        number_of_lines = sum(1 for line in captured_output.split('\n') if line)

        assert number_of_lines == len(GRID_NAMES)
Exemple #6
0
    def test_list_configured_all(self):
        self.args.append('-l')
        self.args.append('--all')
        with capture() as (out, err):
            grids_command(self.args)
        captured_output = out.getvalue()
        for grid in GRID_NAMES + UNUSED_GRID_NAMES:
            assert grid in captured_output

        number_of_lines = sum(1 for line in captured_output.split('\n') if line)

        assert number_of_lines == len(UNUSED_GRID_NAMES) + len(GRID_NAMES)
    def test_list_configured_all(self):
        self.args.append('-l')
        self.args.append('--all')
        grids_command(self.args)
        captured_output = sys.stdout.getvalue()
        for grid in GRID_NAMES + UNUSED_GRID_NAMES:
            assert grid in captured_output

        number_of_lines = sum(1 for line in captured_output.split('\n')
                              if line)

        assert number_of_lines == len(UNUSED_GRID_NAMES) + len(GRID_NAMES)
Exemple #8
0
    def test_list_configured_all(self):
        self.args.append("-l")
        self.args.append("--all")
        with capture() as (out, err):
            grids_command(self.args)
        captured_output = out.getvalue()
        for grid in GRID_NAMES + UNUSED_GRID_NAMES:
            assert grid in captured_output

        number_of_lines = sum(1 for line in captured_output.split("\n")
                              if line)

        assert number_of_lines == len(UNUSED_GRID_NAMES) + len(GRID_NAMES)
 def test_all_grids(self):
     grids_command(self.args)
     captured_output = sys.stdout.getvalue()
     assert "GLOBAL_MERCATOR" in captured_output
     assert "origin*: 'll'" in captured_output
 def test_display_single_grid(self):
     self.args.append('-g')
     self.args.append('GLOBAL_MERCATOR')
     grids_command(self.args)
     captured_output = sys.stdout.getvalue()
     assert "GLOBAL_MERCATOR" in captured_output
Exemple #11
0
 def test_ignore_case(self):
     self.args.append("-g")
     self.args.append("global_geodetic")
     grids_command(self.args)
     captured_output = sys.stdout.getvalue()
     assert "GLOBAL_GEODETIC" in captured_output
Exemple #12
0
 def test_all_grids(self):
     with capture() as (out, err):
         grids_command(self.args)
     captured_output = out.getvalue()
     assert "GLOBAL_MERCATOR" in captured_output
     assert "origin*: 'll'" in captured_output
 def test_all_grids(self):
     grids_command(self.args)
     captured_output = sys.stdout.getvalue()
     assert "GLOBAL_MERCATOR" in captured_output
     assert "origin*: 'sw'" in captured_output
 def test_display_single_grid(self):
     self.args.append('-g')
     self.args.append('GLOBAL_MERCATOR')
     grids_command(self.args)
     captured_output = sys.stdout.getvalue()
     assert "GLOBAL_MERCATOR" in captured_output
Exemple #15
0
 def test_config_not_found(self):
     self.args = ["command_dummy", "-f", "foo.bar"]
     with capture() as (_, err):
         with pytest.raises(SystemExit):
             grids_command(self.args)
     assert err.getvalue().startswith("ERROR:")