-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
10 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,6 @@ | |
|
||
|
||
class Business(Generator): | ||
|
||
""" Create a business.""" | ||
|
||
def __init__(self, redis, features={}): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,32 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
from megacosm.generators import Business | ||
from megacosm.generators import Business, NPC | ||
import unittest2 as unittest | ||
|
||
import redis | ||
from megacosm.util.Seeds import set_seed | ||
|
||
from mock import Mock | ||
from config import TestConfiguration | ||
|
||
|
||
class TestBusiness(unittest.TestCase): | ||
|
||
def setUp(self): | ||
""" """ | ||
|
||
self.redis = redis.from_url(TestConfiguration.REDIS_URL) | ||
|
||
self.seed = set_seed('3') | ||
|
||
def test_business(self): | ||
""" """ | ||
business = Business(self.redis) | ||
self.assertNotEqual('', business.name) | ||
self.assertNotEqual('', "%s" % business) | ||
|
||
def test_senses(self): | ||
""" """ | ||
|
||
business = Business(self.redis, {'smell': 'stank', 'sight': 'ugly blinds', 'sound': 'cries for help'}) | ||
self.assertNotEqual('%s' % business, '') | ||
self.assertNotEqual('', "%s" % business) | ||
|
||
def test_business(self): | ||
""" """ | ||
dummyuser=Mock(NPC) | ||
business = Business(self.redis, { 'owner': dummyuser, 'patroncount': 3, 'trailer': 'a place', 'maxfloors': 2, 'floor': 1 }) | ||
self.assertNotEqual('', "%s" % business) |