nera 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +6 -0
- data/lib/nera/nera_database.rb +26 -2
- data/lib/nera/nera_db_folders.rb +13 -0
- data/lib/nera/nera_job_layer_controller.rb +30 -26
- data/lib/nera/nera_job_records.rb +5 -0
- data/lib/nera/nera_parameter_layer_controller.rb +20 -15
- data/lib/nera/nera_parameter_records.rb +18 -6
- data/lib/nera/nera_remote_connector.rb +50 -20
- data/lib/nera/nera_run_layer_controller.rb +26 -16
- data/lib/nera/nera_run_records.rb +11 -2
- data/lib/nera/nera_simulator_layer_controller.rb +4 -10
- data/lib/nera/nera_simulator_records.rb +8 -0
- data/lib/nera.rb +1 -1
- data/test/test_nera_database.rb +63 -1
- data/test/test_nera_db_folders.rb +8 -0
- data/test/test_nera_job_layer_controller.rb +22 -0
- data/test/test_nera_job_records.rb +13 -0
- data/test/test_nera_parameter_layer_controller.rb +16 -0
- data/test/test_nera_parameter_records.rb +69 -7
- data/test/test_nera_remote_connector.rb +25 -0
- data/test/test_nera_run_layer_controller.rb +27 -0
- data/test/test_nera_run_records.rb +56 -2
- data/test/test_nera_simulator_records.rb +29 -0
- metadata +2 -2
@@ -23,6 +23,20 @@ class TC_NERA_SIM_RECS < Test::Unit::TestCase
|
|
23
23
|
}
|
24
24
|
end
|
25
25
|
|
26
|
+
def test_set_yaml_file
|
27
|
+
@db.set_yaml_file( 'simulators.yml')
|
28
|
+
assert( ! File.exist?( 'simulators.yml') )
|
29
|
+
|
30
|
+
@db.add(Ising)
|
31
|
+
assert( File.exist?( 'simulators.yml') )
|
32
|
+
loaded = YAML.load( File.open('simulators.yml','r') )
|
33
|
+
|
34
|
+
sleep 2
|
35
|
+
@db.touch(1)
|
36
|
+
loaded2 = YAML.load( File.open('simulators.yml','r') )
|
37
|
+
assert( loaded[0][:updated_at] < loaded2[0][:updated_at] )
|
38
|
+
end
|
39
|
+
|
26
40
|
def test_create_table
|
27
41
|
f = NERA::SimulatorRecords.create_table( @path_to_db)
|
28
42
|
assert_equal( nil, f)
|
@@ -111,6 +125,21 @@ class TC_NERA_SIM_RECS < Test::Unit::TestCase
|
|
111
125
|
assert_nil( flag)
|
112
126
|
end
|
113
127
|
|
128
|
+
def test_update
|
129
|
+
add_three
|
130
|
+
sleep 3
|
131
|
+
flag = @db.update( 3)
|
132
|
+
assert_equal(true, flag)
|
133
|
+
r3 = @db.list[2]
|
134
|
+
assert( r3[:created_at] < r3[:updated_at])
|
135
|
+
r2 = @db.list[1]
|
136
|
+
assert( r2[:created_at] == r2[:updated_at])
|
137
|
+
|
138
|
+
# ------
|
139
|
+
flag = @db.update( 500)
|
140
|
+
assert_nil( flag)
|
141
|
+
end
|
142
|
+
|
114
143
|
def test_destroy
|
115
144
|
add_three
|
116
145
|
r3 = @db.list[2]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nera
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yohsuke Murase
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-05-
|
12
|
+
date: 2009-05-24 00:00:00 +09:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|