Skip to content

Commit

Permalink
more testing on businesses
Browse files Browse the repository at this point in the history
  • Loading branch information
morgajel committed Sep 6, 2014
1 parent 937bd66 commit ae26af8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
1 change: 0 additions & 1 deletion megacosm/generators/business.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@


class Business(Generator):

""" Create a business."""

def __init__(self, redis, features={}):
Expand Down
19 changes: 10 additions & 9 deletions tests/test_business.py
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)

0 comments on commit ae26af8

Please sign in to comment.