kopia lustrzana https://github.com/OpenDroneMap/WebODM
Fix tests
rodzic
71eed604c3
commit
34fea3caaa
|
@ -134,10 +134,9 @@ class Thumbnail(TaskNestedView):
|
|||
|
||||
sx = (p['x'] + (0.5 - center_x)) * sw
|
||||
sy = (p['y'] + (0.5 - center_y)) * sh
|
||||
#x = sx / scale_factor
|
||||
#y = sy / scale_factor
|
||||
x = sx - off_x * scale_factor
|
||||
y = sy - off_y * scale_factor
|
||||
|
||||
d.ellipse([(x - r, y - r),
|
||||
(x + r, y + r)], outline=p['color'], width=int(max(1.0, math.floor(r / 3.0))))
|
||||
|
||||
|
|
|
@ -126,7 +126,7 @@ class GCPPopup extends React.Component {
|
|||
}
|
||||
|
||||
render(){
|
||||
const { error, loading, expandGCPImage, selectedShot, zoom } = this.state;
|
||||
const { error, loading, expandGCPImage, selectedShot } = this.state;
|
||||
const { feature, task } = this.props;
|
||||
|
||||
const downloadGCPLink = `/api/projects/${task.project}/tasks/${task.id}/download/ground_control_points.geojson`;
|
||||
|
|
|
@ -313,8 +313,6 @@ class Map extends React.Component {
|
|||
overlays: {$push: [gcpLayer]}
|
||||
}));
|
||||
|
||||
gcpLayer.addTo(this.map); // TODO REMOVE
|
||||
|
||||
this.addedGroundControlPoints = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import ImagePopup from '../GCPPopup';
|
||||
|
||||
describe('<GCPPopup />', () => {
|
||||
it('renders without exploding', () => {
|
||||
const wrapper = mount(<GCPPopup task={{id: 1, project: 1}} feature={{properties: {id: "test", observations: []}}} />);
|
||||
expect(wrapper.exists()).toBe(true);
|
||||
})
|
||||
});
|
|
@ -362,6 +362,7 @@ class TestApiTask(BootTransactionTestCase):
|
|||
# Can download assets
|
||||
for asset in list(task.ASSETS_MAP.keys()):
|
||||
res = client.get("/api/projects/{}/tasks/{}/download/{}".format(project.id, task.id, asset))
|
||||
print("DOWLOAD: " + asset)
|
||||
self.assertEqual(res.status_code, status.HTTP_200_OK)
|
||||
|
||||
# We can stream downloads
|
||||
|
@ -420,6 +421,14 @@ class TestApiTask(BootTransactionTestCase):
|
|||
self.assertEqual(i.width, 48)
|
||||
self.assertEqual(i.height, 36)
|
||||
|
||||
# Can plot points, recenter thumbnails, zoom
|
||||
res = client.get("/api/projects/{}/tasks/{}/images/thumbnail/tiny_drone_image.jpg?size=9999999¢er_x=0.3¢er_y=0.2&draw_point=0.4,0.4&point_color=ff0000&point_radius=3&zoom=2".format(project.id, task.id))
|
||||
self.assertTrue(res.status_code == status.HTTP_200_OK)
|
||||
with Image.open(io.BytesIO(res.content)) as i:
|
||||
# Thumbnail has been resized to the max allowed (oringinal image size)
|
||||
self.assertEqual(i.width, 48)
|
||||
self.assertEqual(i.height, 36)
|
||||
|
||||
# Can download images
|
||||
res = client.get("/api/projects/{}/tasks/{}/images/download/tiny_drone_image.jpg".format(project.id, task.id))
|
||||
self.assertTrue(res.status_code == status.HTTP_200_OK)
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 019629c0df581d0bcab56178918120a5b0ed882e
|
||||
Subproject commit 2fb254e378abfa42ddd04bd0662583b9dbe277bf
|
|
@ -143,7 +143,7 @@ class TestClientApi(TestCase):
|
|||
|
||||
# Verify that options have been updated after restarting the task
|
||||
task_info = api.get_task(uuid).info()
|
||||
self.assertTrue(len(task_info.options) == 1)
|
||||
self.assertTrue(len(task_info.options) == 2) # pc-ept has been added
|
||||
self.assertTrue(task_info.options[0]['name'] == 'mesh-size')
|
||||
self.assertTrue(task_info.options[0]['value'] == 12345)
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue