<commit_before>import boto.swf.layer2
from boto.swf.layer2 import Domain, ActivityType, WorkflowType, WorkflowExecution
from tests.unit import unittest
from mock import Mock


class TestDomain(unittest.TestCase):

    def setUp(self):
        boto.swf.layer2.Layer1 = Mock()
        self.domain = Domain(name='test-domain', description='My test domain')
        self.domain.aws_access_key_id = 'inheritable access key'
        self.domain.aws_secret_access_key = 'inheritable secret key'
	self.domain.region = 'test-region'

    def test_domain_instantiation(self):
        self.assertEquals('test-domain', self.domain.name)
        self.assertEquals('My test domain', self.domain.description)

    def test_domain_list_activities(self):
        self.domain._swf.list_activity_types.return_value = {
            'typeInfos': [{'activityType': {'name': 'DeleteLocalFile',
                             'version': '1.0'},
            'creationDate': 1332853651.235,
            'status': 'REGISTERED'},
           {'activityType': {'name': 'DoUpdate', 'version': 'test'},
            'creationDate': 1333463734.528,
            'status': 'REGISTERED'},
           {'activityType': {'name': 'GrayscaleTransform',
                             'version': '1.0'},
            'creationDate': 1332853651.18,
            'status': 'REGISTERED'},
           {'activityType': {'name': 'S3Download', 'version': '1.0'},
            'creationDate': 1332853651.264,
            'status': 'REGISTERED'},
           {'activityType': {'name': 'S3Upload', 'version': '1.0'},
            'creationDate': 1332853651.314,
            'status': 'REGISTERED'},
           {'activityType': {'name': 'SepiaTransform', 'version': '1.1'},
            'creationDate': 1333373797.734,
            'status': 'REGISTERED'}]} 
    
        expected_names = ('DeleteLocalFile', 'GrayscaleTransform', 'S3Download', <commit_msg>whitespace<commit_after>import boto.swf.layer2
from boto.swf.layer2 import Domain, ActivityType, WorkflowType, WorkflowExecution
from tests.unit import unittest
from mock import Mock


class TestDomain(unittest.TestCase):

    def setUp(self):
        boto.swf.layer2.Layer1 = Mock()
        self.domain = Domain(name='test-domain', description='My test domain')
        self.domain.aws_access_key_id = 'inheritable access key'
        self.domain.aws_secret_access_key = 'inheritable secret key'
        self.domain.region = 'test-region'

    def test_domain_instantiation(self):
        self.assertEquals('test-domain', self.domain.name)
        self.assertEquals('My test domain', self.domain.description)

    def test_domain_list_activities(self):
        self.domain._swf.list_activity_types.return_value = {
            'typeInfos': [{'activityType': {'name': 'DeleteLocalFile',
                             'version': '1.0'},
            'creationDate': 1332853651.235,
            'status': 'REGISTERED'},
           {'activityType': {'name': 'DoUpdate', 'version': 'test'},
            'creationDate': 1333463734.528,
            'status': 'REGISTERED'},
           {'activityType': {'name': 'GrayscaleTransform',
                             'version': '1.0'},
            'creationDate': 1332853651.18,
            'status': 'REGISTERED'},
           {'activityType': {'name': 'S3Download', 'version': '1.0'},
            'creationDate': 1332853651.264,
            'status': 'REGISTERED'},
           {'activityType': {'name': 'S3Upload', 'version': '1.0'},
            'creationDate': 1332853651.314,
            'status': 'REGISTERED'},
           {'activityType': {'name': 'SepiaTransform', 'version': '1.1'},
            'creationDate': 1333373797.734,
            'status': 'REGISTERED'}]} 
    
        expected_names = ('DeleteLocalFile', 'GrayscaleTransform', 'S3Download', 
{'fraction_non_alphanumeric': 0.14889123548046462, 'fraction_numerical': 0.04963041182682154, 'mean_word_length': 2.6644100580270793, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5883648', 'n_tokens_mistral': 1230, 'n_tokens_neox': 1119, 'n_words': 216}