def test_exists_false(self): indata = 'test.nc' if exists(indata): remove(indata) fdesc = FileDesc(indata) actual = fdesc.exists() expected = False print_test_message('FileDesc.exists() == {}'.format(expected), input=indata, actual=actual, expected=expected) self.assertEqual(actual, expected, 'FileDesc.exists() failed')
def test_exists_true(self): indata = 'test.nc' if not exists(indata): open(indata, 'w').close() fdesc = FileDesc(indata) actual = fdesc.exists() expected = True print_test_message('FileDesc.exists() == {}'.format(expected), input=indata, actual=actual, expected=expected) self.assertEqual(actual, expected, 'FileDesc.exists() failed') if exists(indata): remove(indata)
def test_exists_true(self): indata = "test.nc" if not exists(indata): open(indata, "w").close() fdesc = FileDesc(indata) actual = fdesc.exists() expected = True print_test_message( "FileDesc.exists() == {}".format(expected), input=indata, actual=actual, expected=expected, ) self.assertEqual(actual, expected, "FileDesc.exists() failed") if exists(indata): remove(indata)