def test_from_existing_finds_existing_mbed_os_data(self, tmp_path):
        root_path = pathlib.Path(tmp_path, "my-version-of-mbed-os")
        make_mbed_os_files(root_path)

        mbed_os = MbedOS.from_existing(root_path)

        assert mbed_os.targets_json_file == root_path / "targets" / "targets.json"
    def test_from_existing_finds_existing_mbed_os_data(self, fs):
        root_path = pathlib.Path(fs, "my-version-of-mbed-os")
        make_mbed_os_files(root_path)

        mbed_os = MbedOS.from_existing(root_path)

        self.assertEqual(mbed_os.targets_json_file,
                         root_path / "targets" / "targets.json")
Exemple #3
0
    def test_from_existing_returns_valid_program(self, fs):
        fs_root = pathlib.Path(fs, "foo")
        make_mbed_program_files(fs_root)
        make_mbed_os_files(fs_root / "mbed-os")

        program = MbedProgram.from_existing(fs_root, DEFAULT_BUILD_SUBDIR)

        self.assertTrue(program.files.app_config_file.exists())
        self.assertTrue(program.mbed_os.root.exists())
    def test_from_existing_returns_valid_program(self, mock_repo, fs):
        fs_root = pathlib.Path(fs, "foo")
        make_mbed_program_files(fs_root)
        make_mbed_os_files(fs_root / "mbed-os")

        program = MbedProgram.from_existing(fs_root)

        self.assertTrue(program.files.app_config_file.exists())
        self.assertTrue(program.mbed_os.root.exists())
        self.assertIsNotNone(program.repo)
Exemple #5
0
    def test_from_existing_with_mbed_os_path_returns_valid_program(self, fs):
        fs_root = pathlib.Path(fs, "foo")
        mbed_os_path = fs_root / "extern/mbed-os"
        mbed_os_path.mkdir(parents=True)
        make_mbed_program_files(fs_root)
        make_mbed_os_files(mbed_os_path)

        program = MbedProgram.from_existing(fs_root, DEFAULT_BUILD_SUBDIR, mbed_os_path)

        self.assertTrue(program.files.app_config_file.exists())
        self.assertTrue(program.mbed_os.root.exists())