def setUp(self): super(TestDvcDataFileFixture, self).setUp() self.dvc.add(self.DATA) self.dvc.add(self.DATA_SUB_DIR) if self.cache_dir: shutil.copytree(self.dvc.cache.local.cache_dir, self.cache_dir) class MockConfig: level = 1 force = False default = True name = self.REMOTE url = self.cache_dir cmd = CmdRemoteAdd(MockConfig()) cmd.run() self.git.index.add([ os.path.join(self.DATA_DIR, self.DATA_DVC_FILE), os.path.join(self.DATA_DIR, self.DATA_DIR_DVC_FILE), os.path.join(self.DATA_DIR, ".gitignore"), ".dvc/config", self.FOO, self.BAR, ]) self.git.index.commit("Hello world commit") # Return to the dir we started to not confuse parent fixture os.chdir(self._saved_dir)
def setUp(self): super(TestDvcDataFileFixture, self).setUp() self.dvc.add(self.DATA) self.dvc.add(self.DATA_SUB_DIR) if self.cache_dir: shutil.copytree(self.dvc.cache.local.cache_dir, self.cache_dir) class MockConfig: system = None glob = None local = None default = True name = self.REMOTE url = self.cache_dir cmd = CmdRemoteAdd(MockConfig()) cmd.run() self.git.index.add( [ os.path.join(self.DATA_DIR, self.DATA_DVC_FILE), os.path.join(self.DATA_DIR, self.DATA_DIR_DVC_FILE), os.path.join(self.DATA_DIR, ".gitignore"), ".dvc/config", self.FOO, self.BAR, ] ) self.git.index.commit("Hello world commit")
def test_failed_write(self): class A(object): local = False name = 'myremote' url = 's3://remote' unset = False args = A() cmd = CmdRemoteAdd(args) cmd.configobj.write = None ret = cmd.run() self.assertNotEqual(ret, 0)
def test_failed_write(self): class A(object): system = False glob = False local = False name = "myremote" url = "s3://remote" unset = False args = A() cmd = CmdRemoteAdd(args) cmd.configobj.write = None ret = cmd.run() self.assertNotEqual(ret, 0)