2 import sin_testing
as st
6 class TestFail(st
.SmokeTest
):
10 def build(self
, child
, app_desc
):
11 if not os
.path
.isfile(os
.path
.join(os
.getcwd(),
12 "test", "test_module.erl")):
13 raise "Nome module file"
15 child
.expect(pexpect
.EOF
)
17 if not os
.path
.isfile(os
.path
.join(os
.getcwd(),
18 "_build", app_desc
.project_name
,
19 "lib", app_desc
.project_name
+ "-" +
20 app_desc
.project_version
, "ebin",
22 raise "File Not Built"
25 def output_testdir(self
):
26 path
= os
.path
.join(os
.getcwd(), "test")
29 except OSError as exc
:
30 if exc
.errno
== errno
.EEXIST
:
42 module_file
= os
.path
.join(path
, "test_module.erl")
43 new_file
= open(module_file
, "w")
44 new_file
.write(Module
)
48 def run_custom_gen(self
, child
, appdesc
):
49 child
.expect("your name> ")
50 child
.sendline(appdesc
.user_name
)
51 child
.expect("your email> ")
52 child
.sendline(appdesc
.email
)
53 child
.expect('copyright holder \("%s"\)> ' % appdesc
.user_name
)
55 child
.expect('project version> ')
56 child
.sendline(appdesc
.project_version
)
57 child
.expect('Please specify the ERTS version \(".*"\)> ')
59 child
.expect('Is this a single application project \("n"\)> ')
61 child
.expect('Would you like a build config\? \("y"\)> ')
63 child
.expect("Project was created, you should be good to go!")
64 child
.expect(pexpect
.EOF
)
67 def test_gen_name(self
):
68 appdesc
= st
.AppDesc(user_name
= "Smoke Test Gen",
69 email
= "noreply@erlware.org",
70 copyright_holder
= "Smoke Test Copy, LLC.",
71 # This needs to match the gen name since
72 # we are overriding it
74 project_version
= "0.134.0.0")
76 self
.run_custom_gen(appdesc
)
78 currentdir
= os
.getcwd()
79 projdir
= os
.path
.join(currentdir
, appdesc
.project_name
)
87 if __name__
== '__main__':