systemProjectLabel = "authz.management.cattle.io/system-project"
defaultProjectLabel = "authz.management.cattle.io/default-project"
initial_system_namespaces = set(["kube-system",
                                "cattle-system",
                                 "kube-public"])


def test_system_project_created(admin_cc):
    projects = admin_cc.management.client.list_project(
               clusterId=admin_cc.cluster.id)
    initial_projects = {}
    initial_projects["Default"] = defaultProjectLabel
    initial_projects["System"] = systemProjectLabel
    required_projects = []

    for project in projects:
        name = project.data_dict()['name']
        if name in initial_projects:
            projectLabel = initial_projects[name]
            assert project.data_dict()['labels'].\
                data_dict()[projectLabel] == 'true'
            required_projects.append(name)

    assert len(required_projects) == len(initial_projects)


def test_system_namespaces_assigned(admin_cc, admin_pc):
    projects = admin_cc.management.client.list_project(
               clusterId=admin_cc.cluster.id)
    systemProject = None
    for project in projects:
        if project.data_dict()['name'] == "System":
            systemProject = project
            break
    assert systemProject is not None

    system_namespaces = admin_cc.client.list_namespace(
                        projectId=systemProject.id)
    system_namespaces_names = set(
        [ns.data_dict()['name'] for ns in system_namespaces])
    assert system_namespaces_names == initial_system_namespaces

@@ -1,24 +1,68 @@
+import pytest%0Afrom rancher import ApiError%0A%0A
 systemProjectLabel = %22au
@@ -209,32 +209,33 @@
 %5B%22kube-system%22,%0A
+ 
                 
@@ -259,32 +259,32 @@
 cattle-system%22,%0A
-
                 
@@ -409,39 +409,32 @@
 t.list_project(%0A
-       
         clusterI
@@ -452,24 +452,24 @@
 cluster.id)%0A
+
     initial_
@@ -1031,18 +1031,8 @@
 n_cc
-, admin_pc
 ):%0A 
@@ -1086,23 +1086,16 @@
 roject(%0A
-       
         
@@ -1121,24 +1121,24 @@
 cluster.id)%0A
+
     systemPr
@@ -1379,32 +1379,16 @@
 espace(%0A
-                
         
@@ -1411,24 +1411,24 @@
 Project.id)%0A
+
     system_n
@@ -1512,16 +1512,16 @@
 paces%5D)%0A
-
     asse
@@ -1576,8 +1576,724 @@
 espaces%0A
+%0A%0Adef test_system_project_cant_be_deleted(admin_mc, admin_cc):%0A    %22%22%22The system project is not allowed to be deleted, test to ensure that is%0A    true%0A    %22%22%22%0A    projects = admin_cc.management.client.list_project(%0A        clusterId=admin_cc.cluster.id)%0A    system_project = None%0A    for project in projects:%0A        if project.data_dict()%5B'name'%5D == %22System%22:%0A            system_project = project%0A            break%0A    assert system_project is not None%0A%0A    # Attempting to delete the template should raise an ApiError%0A    with pytest.raises(ApiError) as e:%0A        admin_mc.client.delete(system_project)%0A    assert e.value.error.status == 405%0A    assert e.value.error.message == 'System Project cannot be deleted'%0A

Add test to valide system-project can't be deleted