From 01912bdca7e2603035c4905c0274f835045d2a2a Mon Sep 17 00:00:00 2001 From: Ashley Gould Date: Mon, 16 Jul 2018 07:23:06 -0700 Subject: [PATCH] organizations: fix python 2.7 test errors --- moto/organizations/models.py | 2 +- tests/test_organizations/test_organizations_boto3.py | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/moto/organizations/models.py b/moto/organizations/models.py index 2e0d6b40d..a165395f7 100644 --- a/moto/organizations/models.py +++ b/moto/organizations/models.py @@ -132,7 +132,7 @@ class FakeOrganizationalUnit(BaseModel): class FakeRoot(FakeOrganizationalUnit): def __init__(self, organization, **kwargs): - super().__init__(organization, **kwargs) + super(FakeRoot, self).__init__(organization, **kwargs) self.type = 'ROOT' self.id = organization.root_id self.name = 'Root' diff --git a/tests/test_organizations/test_organizations_boto3.py b/tests/test_organizations/test_organizations_boto3.py index 496bcd74d..0ac2b61bf 100644 --- a/tests/test_organizations/test_organizations_boto3.py +++ b/tests/test_organizations/test_organizations_boto3.py @@ -4,6 +4,7 @@ import boto3 import sure # noqa import datetime import yaml +import six from moto import mock_organizations from moto.organizations.models import ( @@ -64,7 +65,7 @@ def validate_organizational_unit(org, response): org['Id'], ou['Id'], )) - ou.should.have.key('Name').should.be.a(str) + ou.should.have.key('Name').should.be.a(six.string_types) def validate_account(org, account): @@ -86,7 +87,7 @@ def validate_account(org, account): account['Email'].should.match(EMAIL_REGEX) account['JoinedMethod'].should.be.within(['INVITED', 'CREATED']) account['Status'].should.be.within(['ACTIVE', 'SUSPENDED']) - account['Name'].should.be.a(str) + account['Name'].should.be.a(six.string_types) account['JoinedTimestamp'].should.be.a(datetime.datetime) @@ -101,7 +102,7 @@ def validate_create_account_status(create_status): ]) create_status['Id'].should.match(CREATE_ACCOUNT_STATUS_ID_REGEX) create_status['AccountId'].should.match(ACCOUNT_ID_REGEX) - create_status['AccountName'].should.be.a(str) + create_status['AccountName'].should.be.a(six.string_types) create_status['State'].should.equal('SUCCEEDED') create_status['RequestedTimestamp'].should.be.a(datetime.datetime) create_status['CompletedTimestamp'].should.be.a(datetime.datetime) @@ -144,7 +145,7 @@ def test_list_roots(): org['Id'], root['Id'], )) - root.should.have.key('Name').should.be.a(str) + root.should.have.key('Name').should.be.a(six.string_types) root.should.have.key('PolicyTypes').should.be.a(list) root['PolicyTypes'][0].should.have.key('Type').should.equal('SERVICE_CONTROL_POLICY') root['PolicyTypes'][0].should.have.key('Status').should.equal('ENABLED')