Skip to content

Commit a0a7f63

Browse files
committed
fixing/skipping/deleting tests
1 parent 5ab309c commit a0a7f63

File tree

2 files changed

+16
-20
lines changed

2 files changed

+16
-20
lines changed

tests/fast/test_main.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import unittest
66
from filecmp import cmp
77
from typing import List
8+
from pathlib import Path
89

910
import numpy as np
1011
from numpy import array
@@ -16,9 +17,9 @@
1617

1718

1819
class TestMainModule(unittest.TestCase):
19-
20+
@unittest.skip # i think this is not necessary anymore
2021
def test_read_config_from_example_dir_with_json_ending(self):
21-
config, filename = read_config(is_example=True, filename='ghz_346.json')
22+
config, filename = read_config(is_example=True, filename='config_ghz_346.json')
2223

2324
self.assertEqual(
2425
config['target_state'], ["000", "111", "222", "333"]
@@ -30,7 +31,7 @@ def test_read_config_from_example_dir_without_json_ending(self):
3031
self.assertEqual(
3132
config['target_state'], ["000", "111", "222", "333"]
3233
)
33-
self.assertEqual('ghz_346.json', filename.name)
34+
self.assertEqual('config_ghz_346', Path(filename).stem)
3435

3536
def test_build_starting_graph(self):
3637
cnfg, filename = read_config(is_example=True, filename='ghz_346')
@@ -75,6 +76,7 @@ def test_get_dimensions_and_target_state(self):
7576
self.assertEqual(list(exp[2].values()), actual[2].amplitudes)
7677
self.assertEqual(list(exp[2].keys()), actual[2].kets)
7778

79+
@unittest.skip #does not exist anymore
7880
def test_setup_for_ent(self):
7981
cnfg, filename = read_config(is_example=True, filename='conc_4-3')
8082
exp = ([2, 2, 2, 2], {'dimensions': [2, 2, 2, 2], 'num_ancillas': 0, 'num_particles': 4,
@@ -138,6 +140,7 @@ def test_setup_for_target(self):
138140
self.assertSetEqual(set(map(type, out_config.values())), set(map(type, actual[2].values())))
139141
self.assertEqual(all(out_config.values()), all(actual[2].values()))
140142

143+
@unittest.skip #does not exist anymore
141144
def test_setup_for_fockbasis(self):
142145
cnfg, filename = read_config(is_example=True, filename='fock_tetrahedron_short.json')
143146
actual = setup_for_fockbasis(cnfg)

tests/test_functional.py

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,13 @@ def setUp(self):
2121
def tearDown(self):
2222
self.directory.cleanup()
2323

24-
def test_input_with_json_ending_from_example_dir(self):
25-
runner = CliRunner()
26-
result = runner.invoke(run, ['--example', 'ghz_346.json'])
27-
assert result.exit_code == 0
28-
assert "{'|000000>': True, '|111000>': True, '|222000>': True, '|333000>': True}" in result.output
29-
assert os.path.exists('output/ghz_346/ghz_346/best.json')
30-
assert os.path.exists('output/ghz_346/ghz_346/summary.json')
31-
3224
def test_input_without_json_ending_from_example_dir(self):
3325
runner = CliRunner()
3426
result = runner.invoke(run, ['--example', 'ghz_346'])
3527
assert result.exit_code == 0
3628
assert "{'|000000>': True, '|111000>': True, '|222000>': True, '|333000>': True}" in result.output
37-
assert os.path.exists('output/ghz_346/ghz_346/best.json')
38-
assert os.path.exists('output/ghz_346/ghz_346/summary.json')
29+
assert os.path.exists('output/config_ghz_346/ghz_346/best.json')
30+
assert os.path.exists('output/config_ghz_346/ghz_346/summary.json')
3931

4032
def test_input_with_json_ending_from_custom_dir(self):
4133
input_file = Path(__file__).parent / 'fixtures' / 'ghz_346.json'
@@ -69,21 +61,22 @@ def test_bell_state(self):
6961

7062
def test_lossfunc_ent(self):
7163
runner = CliRunner()
72-
result = runner.invoke(run, ['--example', 'conc_4-3'])
64+
result = runner.invoke(run, ['--example', 'k2maximal4qubitsREAL'])
7365
assert result.exit_code == 0
74-
assert os.path.exists('output/conc_4-3/try/best.json')
75-
assert os.path.exists('output/conc_4-3/try/summary.json')
66+
assert os.path.exists('output/config_k2maximal4qubitreal/try/best.json')
67+
assert os.path.exists('output/config_k2maximal4qubitreal/try/summary.json')
7668

77-
def test_input_with_json_ending_from_example_director_removeConnections(self):
69+
def test_input_without_json_ending_from_example_director_removeConnections(self):
7870
runner = CliRunner()
79-
result = runner.invoke(run, ['--example', 'cnot_22.json'])
71+
result = runner.invoke(run, ['--example', 'toffoli_post'])
8072
assert result.exit_code == 0
8173

82-
def test_input_with_json_ending_from_example_director_startinggraph(self):
74+
def test_input_without_json_ending_from_example_director_startinggraph(self):
8375
runner = CliRunner()
84-
result = runner.invoke(run, ['--example', 'spin3plus_3.json'])
76+
result = runner.invoke(run, ['--example', 'nbody3'])
8577
assert result.exit_code == 0
8678

79+
@unittest.skip #does not exist anymore
8780
def test_input_with_json_ending_from_example1_director(self):
8881
runner = CliRunner()
8982
result = runner.invoke(run, ['--example', 'werner.json'])

0 commit comments

Comments
 (0)