def test_get_user_logic_quota(self):
        testuser = StacksyncUser(name=self.user_name, email="*****@*****.**", quota_limit=100)
        testuser.save()

        self.assertEquals(100, testuser.quota_limit)

        testuser.delete()
    def test_delete_user(self, mock):
        testuser = StacksyncUser(name="AAA", email="*****@*****.**")
        testuser.save()
        self.assertIsNotNone(testuser.id)

        testuser.delete()
        self.assertIsNone(testuser.id)
Exemple #3
0
    def test_get_user_logic_quota(self):
        testuser = StacksyncUser(name=self.user_name, email="*****@*****.**", quota_limit=100)
        testuser.save()

        self.assertEquals(100, testuser.quota_limit)

        testuser.delete()
Exemple #4
0
    def test_delete_user(self, mock):
        testuser = StacksyncUser(name="AAA", email="*****@*****.**")
        testuser.save()
        self.assertIsNotNone(testuser.id)

        testuser.delete()
        self.assertIsNone(testuser.id)
    def test_add_two_stacksync_users(self):
        testuser1 = StacksyncUser(name=self.user_name, email="*****@*****.**")
        testuser1.save()
        self.assertIsNotNone(testuser1.id)

        testuser2 = StacksyncUser(name=self.user_name, email="*****@*****.**")
        testuser2.save()
        self.assertIsNotNone(testuser2.id)

        self.assertNotEquals(testuser1.id, testuser2.id)

        #cleanup
        testuser1.delete()
        testuser2.delete()
Exemple #6
0
    def test_add_two_stacksync_users(self):
        testuser1 = StacksyncUser(name=self.user_name, email="*****@*****.**")
        testuser1.save()
        self.assertIsNotNone(testuser1.id)

        testuser2 = StacksyncUser(name=self.user_name, email="*****@*****.**")
        testuser2.save()
        self.assertIsNotNone(testuser2.id)

        self.assertNotEquals(testuser1.id, testuser2.id)

        #cleanup
        testuser1.delete()
        testuser2.delete()
class FunctionalStacksyncUserTests(TestCase):
    """
    This class connects to all the databases, and openstack services.
    Therefore it is slow.
    """

    def __init__(self, *args, **kwargs):
        self.user_name = "testuser"
        super(FunctionalStacksyncUserTests, self).__init__(*args, **kwargs)

    def setUp(self):
        self.testuser = StacksyncUser(name=self.user_name, email="*****@*****.**")
        self.testuser.save()

    def tearDown(self):
        self.testuser.delete()

    def test_add_two_stacksync_users(self):
        testuser1 = StacksyncUser(name=self.user_name, email="*****@*****.**")
        testuser1.save()
        self.assertIsNotNone(testuser1.id)

        testuser2 = StacksyncUser(name=self.user_name, email="*****@*****.**")
        testuser2.save()
        self.assertIsNotNone(testuser2.id)

        self.assertNotEquals(testuser1.id, testuser2.id)

        #cleanup
        testuser1.delete()
        testuser2.delete()

    def test_get_user_logic_quota(self):
        testuser = StacksyncUser(name=self.user_name, email="*****@*****.**", quota_limit=100)
        testuser.save()

        self.assertEquals(100, testuser.quota_limit)

        testuser.delete()

    def test_user_has_workspaces(self):
        workspaces = self.testuser.get_workspaces()
        number_of_workspaces_for_user = len(workspaces)

        self.assertNotEquals(number_of_workspaces_for_user, 0)

    def test_user_container_exists(self):
        workspaces = self.testuser.get_workspaces()
        metadata = None
        for workspace in workspaces:
            metadata = workspace.get_container_metadata()
        self.assertIsNotNone(metadata)

    def test_get_physical_quota(self):
        workspaces = self.testuser.get_workspaces()
        workspace = workspaces[0]
        self.assertEquals(0, workspace.get_physical_quota())

    def test_stacksync_parameters(self):
        self.assertIsNotNone(self.testuser.swift_account)
        self.assertIsNotNone(self.testuser.swift_user)
        self.assertIsNotNone(self.testuser.stacksync_tenant)
Exemple #8
0
class FunctionalStacksyncUserTests(TestCase):
    """
    This class connects to all the databases, and openstack services.
    Therefore it is slow.
    """

    def __init__(self, *args, **kwargs):
        self.user_name = "testuser"
        super(FunctionalStacksyncUserTests, self).__init__(*args, **kwargs)

    def setUp(self):
        self.testuser = StacksyncUser(name=self.user_name, email="*****@*****.**")
        self.testuser.save()

    def tearDown(self):
        self.testuser.delete()

    def test_add_two_stacksync_users(self):
        testuser1 = StacksyncUser(name=self.user_name, email="*****@*****.**")
        testuser1.save()
        self.assertIsNotNone(testuser1.id)

        testuser2 = StacksyncUser(name=self.user_name, email="*****@*****.**")
        testuser2.save()
        self.assertIsNotNone(testuser2.id)

        self.assertNotEquals(testuser1.id, testuser2.id)

        #cleanup
        testuser1.delete()
        testuser2.delete()

    def test_get_user_logic_quota(self):
        testuser = StacksyncUser(name=self.user_name, email="*****@*****.**", quota_limit=100)
        testuser.save()

        self.assertEquals(100, testuser.quota_limit)

        testuser.delete()

    def test_user_has_workspaces(self):
        workspaces = self.testuser.get_workspaces()
        number_of_workspaces_for_user = len(workspaces)

        self.assertNotEquals(number_of_workspaces_for_user, 0)

    def test_user_container_exists(self):
        workspaces = self.testuser.get_workspaces()
        metadata = None
        for workspace in workspaces:
            metadata = workspace.get_container_metadata()
        self.assertIsNotNone(metadata)

    def test_get_physical_quota(self):
        workspaces = self.testuser.get_workspaces()
        workspace = workspaces[0]
        self.assertEquals(0, workspace.get_container_quota_limit())

    def test_stacksync_parameters(self):
        self.assertIsNotNone(self.testuser.swift_account)
        self.assertIsNotNone(self.testuser.swift_user)
        self.assertIsNotNone(self.testuser.stacksync_tenant)