Exemple #1
0
  def testWithOffline(self):
    creator = HostFileSystemProvider(
        ObjectStoreCreator.ForTest(),
        offline=True,
        constructor_for_test=self._constructor_for_test)

    fs = creator.GetBranch('1500')
    # Offline file system should raise a FileNotFoundError if read is attempted.
    self.assertRaises(FileNotFoundError, fs.ReadSingle(self._idle_path).Get)
Exemple #2
0
  def testWithCaching(self):
    creator = HostFileSystemProvider(
        ObjectStoreCreator.ForTest(),
        constructor_for_test=self._constructor_for_test)

    fs = creator.GetBranch('1500')
    first_read = fs.ReadSingle(self._idle_path).Get()
    self._canned_data['1500']['api']['idle.json'] = 'blah blah blah'
    second_read = fs.ReadSingle(self._idle_path).Get()

    self.assertEqual(first_read, second_read)