示例#1
0
 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')
示例#2
0
 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)
示例#3
0
 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)