def setUp(self): self.dummyWatch = Box() self.config = Config() self.config.add_path(LATEST_CONFIG_PATH) self.config.load_file_data() self.assertTrue(self.config.is_valid) self.dashboard = Dashboard(self.config) self.dashboard.compose_watch = self.dummyWatch self.dashboard.user_watches = self.dummyWatch self.dashboard.system_watch = self.dummyWatch self._create_box()
def setUp(self): inspector = MagicMock() inspector.get_git_revision_from_path.return_value = "master" self.config = Config() self.config.add_path(LATEST_CONFIG_PATH) self.config.load_file_data() self.watch = DockerComposeWatch( config=self.config, version=self.config.version, git=inspector, docker=inspector, )
def __init__( self, cabrita_path: str, compose_path: tuple, background_color: Optional[str] = "black", version: str = "dev", ) -> None: """Init class.""" self.version = version self.cabrita_path = cabrita_path self.config = Config() self.config.add_path(self.cabrita_path) self.config.load_file_data() self.config.manual_compose_paths = list(compose_path) self.compose = None # type: Compose self.dashboard = None # type: Dashboard self._background_color = background_color
def test_bad_config(self): self.config = Config() self.config.add_path("./sheep/config/cabrita-v2.yml") self.config.load_file_data() self.config.data["layout"] = "triangular" self.config.data["background_color"] = "no_color" self.config.data["compose_files"] = {} self.config.data["boxes"] = { "wrong_box": { "size": "ultra_large", "port_view": "wrong_option", "port_detail": "wrong_option", "watch_for_build_using_files": {}, "watch_for_build_using_git": {}, "includes": {}, "categories": {}, } } self.config.data["ignore_services"] = {} self.assertFalse(self.config.is_valid)
def _generate_config(self): self.config = Config() self.config.add_path(LATEST_CONFIG_PATH) self.config.load_file_data() self.assertTrue(self.config.is_valid)
def _generate_config(self): self.config = Config() self.config.add_path("./sheep/config/cabrita-v1.yml") self.config.load_file_data() self.assertTrue(self.config.is_valid)
def _generate_config(self): self.config = Config() self.config.manual_compose_paths = self.manual_files self.config.load_file_data() self.assertTrue(self.config.is_valid)