Skip to content

Commit

Permalink
fix: jscpd: Clone found
Browse files Browse the repository at this point in the history
  • Loading branch information
jhutar committed Nov 9, 2023
1 parent 1dcf12e commit a4dd113
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions tests/test_cluster_read.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,30 +130,20 @@ def test_copy_from(self):
string = """
- name: somevalue
constant: Hello world
- name: mycopyfrom
- name: mycopyfrom_exists
copy_from: somevalue
- name: mycopyfrom_missing
copy_from: somevalue_that_does_not_exist
"""
ri = opl.cluster_read.RequestedInfo(string)
k, v = next(ri)
self.assertEqual(k, "somevalue")
self.assertEqual(v, "Hello world")
k, v = next(ri)
self.assertEqual(k, "mycopyfrom")
self.assertEqual(v, "Hello world")

def test_copy_from_negative(self):
string = """
- name: somevalue
constant: Hello world
- name: mycopyfrom
copy_from: somevalue_that_does_not_exist
"""
ri = opl.cluster_read.RequestedInfo(string)
k, v = next(ri)
self.assertEqual(k, "somevalue")
self.assertEqual(k, "mycopyfrom_exists")
self.assertEqual(v, "Hello world")
k, v = next(ri)
self.assertEqual(k, "mycopyfrom")
self.assertEqual(k, "mycopyfrom_missing")
self.assertEqual(v, None)

def test_wrong_config(self):
Expand Down

0 comments on commit a4dd113

Please sign in to comment.