rubypython 0.2.7 → 0.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +3 -0
- data/lib/rubypython/version.rb +1 -1
- data/test/test_rubypython.rb +12 -12
- data/test/test_rubypython_bridge_extn.rb +2 -2
- data/website/index.txt +1 -1
- metadata +2 -2
data/History.txt
CHANGED
data/lib/rubypython/version.rb
CHANGED
data/test/test_rubypython.rb
CHANGED
@@ -7,19 +7,19 @@ class TestRubypython < Test::Unit::TestCase
|
|
7
7
|
|
8
8
|
|
9
9
|
def test_simple
|
10
|
-
assert
|
11
|
-
assert
|
12
|
-
assert(RubyPython.stop)
|
13
|
-
assert(!RubyPython.stop)
|
10
|
+
assert(RubyPython.start,"RubyPython failed to initialize.")
|
11
|
+
assert(RubyPython.import("urllib"), "urllib library import failed.")
|
12
|
+
assert(RubyPython.stop,"RubyPython failed to halt.")
|
13
|
+
assert(!RubyPython.stop,"RubyPython did not realize it had halted.")
|
14
14
|
end
|
15
15
|
|
16
16
|
def test_delegation
|
17
17
|
RubyPython.start
|
18
18
|
cPickle=RubyPython.import("cPickle")
|
19
19
|
assert_instance_of(RubyPythonBridge::RubyPyModule,cPickle)
|
20
|
-
assert_equal(cPickle.loads("(dp1\nS'a'\nS'n'\ns(I1\nS'2'\ntp2\nI4\ns.")
|
20
|
+
assert_equal({"a"=>"n", [1, "2"]=>4},cPickle.loads("(dp1\nS'a'\nS'n'\ns(I1\nS'2'\ntp2\nI4\ns."))
|
21
21
|
dumped_array=cPickle.dumps([1,2,3,4])
|
22
|
-
assert_equal(
|
22
|
+
assert_equal([1,2,3,4],cPickle.loads(dumped_array))
|
23
23
|
assert_raise NoMethodError do
|
24
24
|
cPickle.splack
|
25
25
|
end
|
@@ -38,7 +38,7 @@ class TestRubypython < Test::Unit::TestCase
|
|
38
38
|
RubyPython.stop
|
39
39
|
end
|
40
40
|
|
41
|
-
def
|
41
|
+
def test_propogate_python_error
|
42
42
|
RubyPython.start
|
43
43
|
assert_raise PythonError do
|
44
44
|
RubyPython.import "slasdfj"
|
@@ -53,7 +53,7 @@ class TestRubypython < Test::Unit::TestCase
|
|
53
53
|
cPickle.inspect
|
54
54
|
unpickled=cPickle.loads("(dp1\nS'a'\nS'n'\ns(I1\nS'2'\ntp2\nI4\ns.")
|
55
55
|
end
|
56
|
-
assert_equal(
|
56
|
+
assert_equal({"a"=>"n", [1, "2"]=>4},unpickled)
|
57
57
|
assert(!RubyPython.stop)
|
58
58
|
end
|
59
59
|
|
@@ -61,14 +61,14 @@ class TestRubypython < Test::Unit::TestCase
|
|
61
61
|
RubyPython.start
|
62
62
|
wave=RubyPython.import "wave"
|
63
63
|
w=wave.open("test/test.wav","rb")
|
64
|
-
assert_equal(w.getframerate
|
64
|
+
assert_equal(9600,w.getframerate)
|
65
65
|
w.close
|
66
66
|
RubyPython.stop
|
67
67
|
end
|
68
68
|
|
69
69
|
def test_pymain_delegation
|
70
70
|
RubyPython.start
|
71
|
-
assert_equal(PyMain.float(42)
|
71
|
+
assert_equal(42.to_f,PyMain.float(42))
|
72
72
|
RubyPython.stop
|
73
73
|
end
|
74
74
|
|
@@ -78,7 +78,7 @@ class TestRubypython < Test::Unit::TestCase
|
|
78
78
|
returned=PyMain.float(22) do |f|
|
79
79
|
f*2
|
80
80
|
end
|
81
|
-
assert_equal(
|
81
|
+
assert_equal(44.0,returned)
|
82
82
|
RubyPython.stop
|
83
83
|
end
|
84
84
|
|
@@ -86,7 +86,7 @@ class TestRubypython < Test::Unit::TestCase
|
|
86
86
|
RubyPython.session do
|
87
87
|
cPickle=RubyPython.import "cPickle"
|
88
88
|
cPickle.inspect
|
89
|
-
assert_equal(cPickle.loads("(dp1\nS'a'\nS'n'\ns(I1\nS'2'\ntp2\nI4\ns.")
|
89
|
+
assert_equal({"a"=>"n", [1, "2"]=>4},cPickle.loads("(dp1\nS'a'\nS'n'\ns(I1\nS'2'\ntp2\nI4\ns."))
|
90
90
|
end
|
91
91
|
end
|
92
92
|
|
@@ -7,7 +7,7 @@ class TestRubyPythonBridgeExtn < Test::Unit::TestCase
|
|
7
7
|
|
8
8
|
def test_func_with_module
|
9
9
|
pickle_return=RubyPythonBridge.func("cPickle","loads","(dp1\nS'a'\nS'n'\ns(I1\nS'2'\ntp2\nI4\ns.")
|
10
|
-
assert_equal(
|
10
|
+
assert_equal({"a"=>"n", [1, "2"]=>4},pickle_return)
|
11
11
|
end
|
12
12
|
|
13
13
|
def test_start_stop
|
@@ -53,7 +53,7 @@ class TestRubyPythonBridgeWithCPickle < Test::Unit::TestCase
|
|
53
53
|
end
|
54
54
|
|
55
55
|
def test_data_passing
|
56
|
-
assert_equal(
|
56
|
+
assert_equal({"a"=>"n", [1, "2"]=>4},@cPickle.loads("(dp1\nS'a'\nS'n'\ns(I1\nS'2'\ntp2\nI4\ns."))
|
57
57
|
dumped_array=@cPickle.dumps([1,2,3,4])
|
58
58
|
assert_equal(@cPickle.loads(dumped_array),[1,2,3,4])
|
59
59
|
end
|
data/website/index.txt
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubypython
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zach Raines
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-10-05 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|