HG changeset patch User Yury Yurevich the pythy gmail com Date 1251004

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# HG changeset patch
# User Yury Yurevich <the.pythy@gmail.com>
# Date 1251004226 -25200
# Node ID 72fc9f3fd00ac2ef73d4ae683e2282de33fffb17
# Parent 624fde5f4928f6475475741bf5a19b459d7a3303
functests: Refactor functional tests for reuse it
diff -r 624fde5f4928 -r 72fc9f3fd00a aguila/functests/__init__.py
--- a/aguila/functests/__init__.py Sun Aug 23 03:27:19 2009 +0000
+++ b/aguila/functests/__init__.py Sun Aug 23 12:10:26 2009 +0700
@@ -5,21 +5,19 @@
from django_satprep import twill_utils
import twill
import glob
-from os.path import abspath, dirname, basename, join
+from os import path, chdir
def setup():
+ chdir(path.abspath(path.dirname(__file__)))
twill_utils.setup()
-def get_path(fn):
- return join(abspath(dirname(__file__)), fn)
-
def run_twill(twill_file):
twill.execute_string('reset_browser')
- twill.execute_file(get_path(twill_file))
+ twill.execute_file(twill_file)
@with_setup(setup)
def test_with_twill():
- for twill_file in glob.glob(get_path('*.twill')):
- yield run_twill, basename(twill_file)
+ for twill_file in glob.glob('*.twill'):
+ yield run_twill, twill_file
diff -r 624fde5f4928 -r 72fc9f3fd00a aguila/functests/_login.twill
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/aguila/functests/_login.twill Sun Aug 23 12:10:26 2009 +0700
@@ -0,0 +1,9 @@
+setlocal username binary
+setlocal password test
+
+runfile _start.twill
+
+formvalue 1 username $username
+formvalue 1 password $password
+submit
+code 200
diff -r 624fde5f4928 -r 72fc9f3fd00a aguila/functests/_start.twill
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/aguila/functests/_start.twill Sun Aug 23 12:10:26 2009 +0700
@@ -0,0 +1,4 @@
+go http://127.0.0.1:9876
+code 200
+
+
diff -r 624fde5f4928 -r 72fc9f3fd00a aguila/functests/example.twill
--- a/aguila/functests/example.twill Sun Aug 23 03:27:19 2009 +0000
+++ b/aguila/functests/example.twill Sun Aug 23 12:10:26 2009 +0700
@@ -1,14 +1,5 @@
-setlocal username binary
-setlocal password test
-
-go http://127.0.0.1:9876
-formvalue 1 username $username
-formvalue 1 password $password
-submit
-
-code 200
+runfile _login.twill
find Rome
-
follow Suburb