(t *testing.T)
| 102 | } |
| 103 | |
| 104 | func TestDropNamespaceErr(t *testing.T) { |
| 105 | dc := dgraphtest.NewComposeCluster() |
| 106 | client, cleanup, err := dc.Client() |
| 107 | require.NoError(t, err) |
| 108 | defer cleanup() |
| 109 | |
| 110 | // Drop all data |
| 111 | require.NoError(t, client.Login(context.Background(), |
| 112 | dgraphapi.DefaultUser, dgraphapi.DefaultPassword)) |
| 113 | require.NoError(t, client.DropAll()) |
| 114 | |
| 115 | // Wait for DropAll to complete (async operation) |
| 116 | waitForNamespaceCount(t, client, 1, 30*time.Second) |
| 117 | |
| 118 | // create ns1 |
| 119 | ctx := context.Background() |
| 120 | ns1, err := client.CreateNamespace(ctx) |
| 121 | require.NoError(t, err) |
| 122 | |
| 123 | // Dropping a non-existent namespace should not be an error |
| 124 | require.NoError(t, client.DropNamespace(ctx, ns1)) |
| 125 | require.NoError(t, client.DropNamespace(ctx, uint64(10000000))) |
| 126 | |
| 127 | // Wait for DropNamespace to complete (async operation) |
| 128 | waitForNamespaceCount(t, client, 1, 30*time.Second) |
| 129 | } |
nothing calls this directly
no test coverage detected