def setUp(self):
     """
     Creates a fresh test workspace in a temp dir to ensure
     we do not have conflicts with other CLI tests.
     """
     self.tmp_ws_dir = os.path.join(tempfile.mkdtemp(), "son-workspace")
     ws = Workspace(self.tmp_ws_dir, ws_name="son-profile test workspace")
     ws.create_dirs()
     ws.create_files()
Exemple #2
0
 def setUp(self):
     """
     Creates a fresh test workspace in a temp dir to ensure
     we do not have conflicts with other CLI tests.
     """
     self.tmp_ws_dir = os.path.join(tempfile.mkdtemp(), "son-workspace")
     ws = Workspace(self.tmp_ws_dir, ws_name="son-profile test workspace")
     ws.create_dirs()
     ws.create_files()
Exemple #3
0
    def test_create_dirs(self, m_makedirs):
        """
        Verify if the workspace directory structure
        is being well created.
        """
        # Create a new workspace
        ws = Workspace("workspace/root/dir",
                       ws_name="workspace_name",
                       log_level='log_level')

        # Assure directory structure is well created
        m_makedirs.return_value = None
        ws.create_dirs()
        for call in m_makedirs.call_args_list:
            assert '\'workspace/root/dir' in str(call)
    def test_create_dirs(self, m_makedirs):
        """
        Verify if the workspace directory structure
        is being well created.
        """
        # Create a new workspace
        ws = Workspace("workspace/root/dir",
                       ws_name="workspace_name",
                       log_level='log_level')

        # Assure directory structure is well created
        m_makedirs.return_value = None
        ws.create_dirs()
        for call in m_makedirs.call_args_list:
            assert '\'workspace/root/dir' in str(call)