Skip to content

Instantly share code, notes, and snippets.

@gabrielfalcao
Created July 9, 2010 03:10
Show Gist options
  • Save gabrielfalcao/468977 to your computer and use it in GitHub Desktop.
Save gabrielfalcao/468977 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import pwd
from lettuce import step, world
@step('Given I have the user "(.*)"')
def given_i_have_the_user_group1(step, user):
world.user = user
@step('When I check the passwd file')
def when_i_check_the_passwd_file(step):
all_users = [x.pw_name for x in pwd.getpwall()]
if world.user in all_users:
world.user_was_found = True
else:
world.user_was_found = False
@step('Then I see it is on there')
def then_i_see_true(step):
assert world.user_was_found, "The user %s is not on pwd file" % world.user
Feature: Ensure users
In order to enable full testing
We need to make sure we can test users
Scenario: Zomojo users
Given I have the user "Hnagios"
When I check the passwd file
Then I see it is on there
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment