Advertisement
Guest User

Untitled

a guest
Dec 20th, 2014
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.26 KB | None | 0 0
  1. from behave import *  # @UnusedWildImport
  2. from behave import given, when, then  # @UnresolvedImport
  3. from hamcrest import assert_that, equal_to, is_not
  4. # from trunk.model.choose_workspace import CurrentWorkspace
  5. import imp
  6. # Import oko modula!
  7. my_module = imp.load_source('choose_workspace', 'C:/Users/DMG/workspace/SWEdit/trunk/model/choose_workspace.py')
  8.  
  9. @given('First run')  # @UndefinedVariable
  10. def step_impl(context):
  11.     context.workspace = my_module.CurrentWorkspace()
  12.     context.workspace.current_workspace = ""
  13.    
  14. @when('I choose {directory} in dialog')
  15. def step_impl(context, directory):  # @DuplicatedSignature
  16.     context.workspace.set_current_workspace(directory)
  17.     assert (directory, is_not(equal_to("")))
  18.  
  19. @then('Initialize new workspace and makes it default')  # @UndefinedVariable
  20. def step_impl(context):  # @DuplicatedSignature
  21.     assert_that(context.workspace.current_workspace, is_not(equal_to("")))
  22.  
  23. @given('Not first run')  # @UndefinedVariable
  24. def step_impl(context):  # @DuplicatedSignature
  25.     context.workspace = my_module.CurrentWorkspace()
  26.  
  27. @then('Initialize default workspace')  # @UndefinedVariable
  28. def step_impl(context):  # @DuplicatedSignature
  29.     assert_that(context.workspace.current_workspace, is_not(equal_to("")))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement