Permalink
Browse files

Remove dependency from dingus and fudge.

  • Loading branch information...
1 parent fd3e4f8 commit 62f628d57a72495a12b748568aaf2916642b9eb3 @andreafrancia committed Apr 12, 2012
Showing with 27 additions and 26 deletions.
  1. +0 −2 requirements-dev.txt
  2. +11 −7 unit_tests/test_parser.py
  3. +16 −17 unit_tests/test_parsing_trashinfo_contents.py
View
@@ -1,4 +1,2 @@
nose==1.1.2
mock==0.8.0
-fudge==1.0.3
-dingus==0.3.2
View
@@ -1,11 +1,15 @@
from trashcli.trash import Parser
-from dingus import Dingus
+from mock import MagicMock
+from nose.tools import istest
-def test_parser():
- on_raw = Dingus()
- parser = Parser()
- parser.add_option('raw', on_raw)
+@istest
+class describe_Parser():
+ @istest
+ def it_calls_the_actions_passing_the_program_name(self):
+ on_raw = MagicMock()
+ parser = Parser()
+ parser.add_option('raw', on_raw)
- parser(['trash-list', '--raw'])
+ parser(['trash-list', '--raw'])
- assert on_raw.calls('()')
+ on_raw.assert_called_with('trash-list')
@@ -4,35 +4,34 @@
from nose.tools import istest
from datetime import datetime
-import fudge
+from mock import MagicMock
from trashcli.trash import ParseTrashInfo
-@istest
-class describe_ParseTrashInfo:
+@istest
+class describe_ParseTrashInfo2:
@istest
- @fudge.test
- def it_should_parse_the_date(self):
- result = (fudge.Fake().expects_call()
- .with_args(datetime(1970,1,1,0,0,0)))
+ def it_should_parse_date(self):
+ out = MagicMock()
+ parse = ParseTrashInfo(on_deletion_date = out)
- self.parse = ParseTrashInfo(on_deletion_date = result)
-
- self.parse( '[Trash Info]\n'
- 'Path=foo\n'
- 'DeletionDate=1970-01-01T00:00:00\n')
+ parse('[Trash Info]\n'
+ 'Path=foo\n'
+ 'DeletionDate=1970-01-01T00:00:00\n')
+
+ out.assert_called_with(datetime(1970,1,1,0,0,0))
@istest
- @fudge.test
- def it_should_parse_the_path(self):
- result = (fudge.Fake().expects_call().with_args('foo'))
-
- self.parse = ParseTrashInfo(on_path = result)
+ def it_should_parse_path(self):
+ out = MagicMock()
+ self.parse = ParseTrashInfo(on_path = out)
self.parse( '[Trash Info]\n'
'Path=foo\n'
'DeletionDate=1970-01-01T00:00:00\n')
+ out.assert_called_with('foo')
+
from trashcli.trash import parse_deletion_date
from trashcli.trash import parse_path

0 comments on commit 62f628d

Please sign in to comment.