Debian Codegraph @

extra/haxelib_src/test/tests/integration/TestOwner.hx

raw
1 package tests.integration;
2
3 import haxe.io.*;
4 import IntegrationTests.*;
5 using IntegrationTests;
6
7 class TestOwner extends IntegrationTests {
8 function test():Void {
9 {
10 var r = haxelib(["register", deepAuthor.user, deepAuthor.email, deepAuthor.fullname, deepAuthor.pw, deepAuthor.pw]).result();
11 assertSuccess(r);
12 }
13 {
14 var r = haxelib(["register", anotherGuy.user, anotherGuy.email, anotherGuy.fullname, anotherGuy.pw, anotherGuy.pw]).result();
15 assertSuccess(r);
16 }
17 {
18 var r = haxelib(["register", foo.user, foo.email, foo.fullname, foo.pw, foo.pw]).result();
19 assertSuccess(r);
20 }
21
22
23 /*
24 Only the owner can submit the first version.
25 */
26
27 {
28 var r = haxelib(["submit", Path.join([IntegrationTests.projectRoot, "test/libraries/libDeep.zip"]), anotherGuy.user, anotherGuy.pw]).result();
29 assertFail(r);
30 }
31
32 {
33 var r = haxelib(["submit", Path.join([IntegrationTests.projectRoot, "test/libraries/libDeep.zip"]), deepAuthor.user, deepAuthor.pw]).result();
34 assertSuccess(r);
35 }
36
37 /*
38 Only the owner can change ownership.
39 */
40
41 {
42 var r = haxelib(["submit", Path.join([IntegrationTests.projectRoot, "test/libraries/libDeep2.zip"]), anotherGuy.user, anotherGuy.pw]).result();
43 assertFail(r);
44 }
45
46 {
47 var r = haxelib(["submit", Path.join([IntegrationTests.projectRoot, "test/libraries/libDeep2.zip"]), deepAuthor.user, deepAuthor.pw]).result();
48 assertSuccess(r);
49 }
50
51 /*
52 Only the owner can change contributors.
53 */
54
55 {
56 var r = haxelib(["submit", Path.join([IntegrationTests.projectRoot, "test/libraries/libDeep3.zip"]), foo.user, foo.pw]).result();
57 assertFail(r);
58 }
59
60 {
61 var r = haxelib(["submit", Path.join([IntegrationTests.projectRoot, "test/libraries/libDeep3.zip"]), anotherGuy.user, anotherGuy.pw]).result();
62 assertSuccess(r);
63 }
64 }
65 }