Attempt to fix Python qa code after renames

This commit is contained in:
Jon Evans 2021-06-13 11:19:19 -04:00
parent 74cefecaac
commit 82f3df4086
3 changed files with 9 additions and 9 deletions

View File

@ -166,11 +166,11 @@ static PCB_TARGET* Cast_to_PCB_TARGET( BOARD_ITEM* );
return Cast_to_PAD(self)
elif ct=="MTEXT":
return Cast_to_FP_TEXT(self)
elif ct=="VIA":
elif ct=="PCB_VIA":
return Cast_to_PCB_VIA(self)
elif ct=="TRACK":
elif ct=="PCB_TRACK":
return Cast_to_PCB_TRACK(self)
elif ct=="ARC":
elif ct=="PCB_ARC":
return Cast_to_PCB_ARC(self)
elif ct=="PCB_TARGET":
return Cast_to_PCB_TARGET(self)

View File

@ -31,17 +31,17 @@ class TestBoardClass(unittest.TestCase):
self.assertEqual(pcb.Tracks().size(),0)
track0 = TRACK(pcb)
track0 = PCB_TRACK(pcb)
pcb.Add(track0)
self.assertEqual(pcb.Tracks().size(),1)
track1 = TRACK(pcb)
track1 = PCB_TRACK(pcb)
pcb.Add(track1)
self.assertEqual(pcb.Tracks().size(),2)
def test_pcb_bounding_box(self):
pcb = BOARD()
track = TRACK(pcb)
track = PCB_TRACK(pcb)
pcb.Add(track)
track.SetStart(wxPointMM(10.0, 10.0))

View File

@ -7,7 +7,7 @@ class TestTracks(unittest.TestCase):
self.pcb = pcbnew.LoadBoard("data/tracks_arcs_vias.kicad_pcb")
def test_tracks(self):
tracks = [t for t in self.pcb.Tracks() if t.GetClass() == 'TRACK']
tracks = [t for t in self.pcb.Tracks() if t.GetClass() == 'PCB_TRACK']
self.assertEqual(16, len(tracks))
track = sorted(tracks, key=lambda t: [t.GetStart()[0], t.GetStart()[1]])[0]
self.assertEqual([27000000, 27585787], [track.GetStart()[0], track.GetStart()[1]])
@ -16,7 +16,7 @@ class TestTracks(unittest.TestCase):
self.assertEqual('McNetty', track.GetNetname())
def test_arcs(self):
arcs = [t for t in self.pcb.Tracks() if t.GetClass() == 'ARC']
arcs = [t.Cast() for t in self.pcb.Tracks() if t.GetClass() == 'PCB_ARC']
self.assertEqual(13, len(arcs))
arc = sorted(arcs, key=lambda t: [t.GetStart()[0], t.GetStart()[1]])[0]
self.assertEqual([29414211, 26499999], [arc.GetCenter()[0], arc.GetCenter()[1]])
@ -24,7 +24,7 @@ class TestTracks(unittest.TestCase):
self.assertEqual(2414211, round(arc.GetRadius()))
def test_vias(self):
vias = [t for t in self.pcb.Tracks() if t.GetClass() == 'VIA']
vias = [t.Cast() for t in self.pcb.Tracks() if t.GetClass() == 'PCB_VIA']
self.assertEqual(2, len(vias))
via = sorted(vias, key=lambda t: [t.GetStart()[0], t.GetStart()[1]])[0]
self.assertEqual([29000000, 41000000], [via.GetStart()[0], via.GetStart()[1]])