Example #1
0
    def test_finds_program_higher_in_dir_tree(self, fs):
        program_root = pathlib.Path(fs, "foo")
        pwd = program_root / "subprojfoo" / "libbar"
        make_mbed_program_files(program_root)
        pwd.mkdir(parents=True)

        self.assertEqual(_find_program_root(pwd), program_root.resolve())
Example #2
0
    def test_finds_program_higher_in_dir_tree(self, tmp_path):
        program_root = pathlib.Path(tmp_path, "foo")
        pwd = program_root / "subprojfoo" / "libbar"
        make_mbed_program_files(program_root)
        pwd.mkdir(parents=True)

        assert _find_program_root(pwd) == program_root.resolve()
Example #3
0
    def test_raises_if_no_program_found(self, fs):
        program_root = pathlib.Path(fs, "foo")
        program_root.mkdir()

        with self.assertRaises(ProgramNotFound):
            _find_program_root(program_root)
Example #4
0
    def test_finds_program_at_current_path(self, fs):
        program_root = pathlib.Path(fs, "foo")
        make_mbed_program_files(program_root)

        self.assertEqual(_find_program_root(program_root), program_root.resolve())
Example #5
0
    def test_raises_if_no_program_found(self, tmp_path):
        program_root = pathlib.Path(tmp_path, "foo")
        program_root.mkdir()

        with pytest.raises(ProgramNotFound):
            _find_program_root(program_root)
Example #6
0
    def test_finds_program_at_current_path(self, tmp_path):
        program_root = pathlib.Path(tmp_path, "foo")
        make_mbed_program_files(program_root)

        assert _find_program_root(program_root) == program_root.resolve()