Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from behave import * # @UnusedWildImport
- from behave import given, when, then # @UnresolvedImport
- from hamcrest import assert_that, equal_to, is_not
- # from trunk.model.choose_workspace import CurrentWorkspace
- import imp
- # Import oko modula!
- my_module = imp.load_source('choose_workspace', 'C:/Users/DMG/workspace/SWEdit/trunk/model/choose_workspace.py')
- @given('First run') # @UndefinedVariable
- def step_impl(context):
- context.workspace = my_module.CurrentWorkspace()
- context.workspace.current_workspace = ""
- @when('I choose {directory} in dialog')
- def step_impl(context, directory): # @DuplicatedSignature
- context.workspace.set_current_workspace(directory)
- assert (directory, is_not(equal_to("")))
- @then('Initialize new workspace and makes it default') # @UndefinedVariable
- def step_impl(context): # @DuplicatedSignature
- assert_that(context.workspace.current_workspace, is_not(equal_to("")))
- @given('Not first run') # @UndefinedVariable
- def step_impl(context): # @DuplicatedSignature
- context.workspace = my_module.CurrentWorkspace()
- @then('Initialize default workspace') # @UndefinedVariable
- def step_impl(context): # @DuplicatedSignature
- assert_that(context.workspace.current_workspace, is_not(equal_to("")))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement