Skip to content

Commit

Permalink
resource import controller: get_previous_imported_controller returns …
Browse files Browse the repository at this point in the history
…None when no previous
  • Loading branch information
Mikko Korpela committed Aug 15, 2012
1 parent 8e95700 commit 3c491d2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/robotide/controller/settingcontrollers.py
Expand Up @@ -493,6 +493,7 @@ def publish_removed(self):
class ResourceImportController(_ImportController):
is_resource = True
_resolved_import = False
_previous_imported_controller = None

def set_value(self, name, args=None, alias=''):
self._previous_imported_controller = self.get_imported_controller()
Expand Down
7 changes: 6 additions & 1 deletion utest/controller/test_resource_import.py
Expand Up @@ -63,12 +63,17 @@ def test_resource_import_knows_resource_after_import_has_been_removed(self):
item_without_settings.imports.delete(0)
self.assertEqual(self.new_resource, import_.get_imported_controller())

def test_previously_imported_resource_controller_is_none_by_default(self):
self._create_resource()
import_controller = self._add_resource_import_to_suite()
self.assertIsNone(import_controller.get_previous_imported_controller())

@property
def _keyword_controller(self):
return self.ctrl.resources[-1].keywords[-1]

def _add_resource_import_to_suite(self):
self.suite.imports.add_resource(self.res_name)
return self.suite.imports.add_resource(self.res_name)

def _verify_unidentified_keyword(self):
self._check_cells(ContentType.STRING, CellType.UNKNOWN)
Expand Down

0 comments on commit 3c491d2

Please sign in to comment.