Skip to content

Commit

Permalink
Dropped directory content size calculation.
Browse files Browse the repository at this point in the history
  • Loading branch information
zebulasampedro committed Oct 25, 2016
1 parent 49aa820 commit 25b666c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions sandstone/apps/filebrowser/posixfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,12 @@ def get_dir_contents(dirpath):
if os.path.isdir(filepath):
filepath = os.path.join(filepath, '')

if os.path.isdir(filepath):
size = PosixFS.get_size(filepath)
else:
size = parts[5]
if not size[-1].isalpha():
size = size + ' bytes'
# if os.path.isdir(filepath):
# size = PosixFS.get_size(filepath)
# else:
size = parts[5]
if not size[-1].isalpha():
size = size + ' bytes'

dir_contents.append({
'size': size,
Expand Down
6 changes: 3 additions & 3 deletions sandstone/lib/tests/python/test_filewatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def test_remove_directory_to_watch(self):
Filewatcher.remove_directory_to_watch(self.test_dir)
self.assertEqual(len(Filewatcher._watches), 0)

@mock.patch('sandstone.filewatcher.BroadcastManager.broadcast')
@mock.patch('sandstone.lib.broadcast.manager.BroadcastManager.broadcast')
def test_file_created_event(self, mock_broadcast):
Filewatcher.add_directory_to_watch(self.test_dir)
# create temp file
Expand All @@ -58,7 +58,7 @@ def test_file_created_event(self, mock_broadcast):
self.assertEqual(key, broadcast_call_msg.key)
self.assertEqual(data, broadcast_call_msg.data)

@mock.patch('sandstone.filewatcher.BroadcastManager.broadcast')
@mock.patch('sandstone.lib.broadcast.manager.BroadcastManager.broadcast')
def test_file_deleted_event(self, mock_broadcast):
# create temp file
filepath = os.path.join(self.test_dir, 'tmp.txt')
Expand All @@ -79,7 +79,7 @@ def test_file_deleted_event(self, mock_broadcast):
self.assertEqual(key, broadcast_call_msg.key)
self.assertEqual(data, broadcast_call_msg.data)

@mock.patch('sandstone.filewatcher.BroadcastManager.broadcast')
@mock.patch('sandstone.lib.broadcast.manager.BroadcastManager.broadcast')
def test_file_moved_event(self, mock_broadcast):
# create a temporary file
filepath = os.path.join(self.test_dir, 'tmp.txt')
Expand Down

0 comments on commit 25b666c

Please sign in to comment.