Skip to content

Commit

Permalink
テストの修正
Browse files Browse the repository at this point in the history
  • Loading branch information
duri0214 committed Jan 8, 2024
1 parent 84864b7 commit df08d5b
Show file tree
Hide file tree
Showing 43 changed files with 16 additions and 9 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
from unittest import TestCase

from soil_analysis.domain.service.photoprocessingservice import PhotoProcessingService
Expand All @@ -20,9 +21,10 @@ def setUp(self) -> None:
'137.6492192,34.7429904 137.6489738,34.7433604')
self.land_candidates = LandCandidates([self.land1, self.land2, self.land3, self.land4])

script_directory = os.path.dirname(os.path.abspath(__file__))
self.photo_paths = [
r"D:/OneDrive/dev/soil_analysisローカルデータ/サンプルデータ/android/ススムB1_right.jpg",
r"D:/OneDrive/dev/soil_analysisローカルデータ/サンプルデータ/android/ススムB2.jpg"
os.path.join(script_directory, r"./android/ススムB1_right.jpg"),
os.path.join(script_directory, r"./android/ススムB2.jpg")
]

def test_calculate_distance(self):
Expand Down Expand Up @@ -63,9 +65,10 @@ def test_find_nearest_land_a4(self):
def test_process_photos(self):
service = PhotoProcessingService()
processed_photos = service.process_photos(self.photo_paths, self.land_candidates)
# 期待される処理後の写真のリストと一致するか検証する ススムは 6/18 のグーグルフォトにある
# 期待される処理後の写真のリストと一致するか検証する ススムは 2023/6/18 のグーグルフォトにある
script_directory = os.path.dirname(os.path.abspath(__file__))
expected_processed_photos = [
"D:/OneDrive/dev/soil_analysisローカルデータ/サンプルデータ/android/ススムB1_right.jpg",
"D:/OneDrive/dev/soil_analysisローカルデータ/サンプルデータ/android/ススムB2.jpg"
os.path.join(script_directory, "./android/ススムB1_right.jpg"),
os.path.join(script_directory, "./android/ススムB2.jpg")
]
self.assertEqual(expected_processed_photos, processed_photos)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
from unittest import TestCase

from soil_analysis.domain.valueobject.capturelocation import CaptureLocation
Expand All @@ -6,8 +7,9 @@

class TestAndroidPhoto(TestCase):
def setUp(self):
self.file_path = r"D:/OneDrive/dev/soil_analysisローカルデータ/サンプルデータ/android/JA中_all.jpg"
self.android_photo = AndroidPhoto(self.file_path)
script_directory = os.path.dirname(os.path.abspath(__file__))
self.file_path = r"./android/JA中_all.jpg"
self.android_photo = AndroidPhoto(os.path.join(script_directory, self.file_path))
self.android_photo.exif_data = self.android_photo._extract_exif_data()

def test_extract_date(self):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
from unittest import TestCase

from soil_analysis.domain.valueobject.capturelocation import CaptureLocation
Expand All @@ -6,8 +7,9 @@

class TestIphonePhoto(TestCase):
def setUp(self):
self.file_path = r"D:/OneDrive/dev/soil_analysisローカルデータ/サンプルデータ/iphone/IMG_1315_left.jpeg"
self.iphone_photo = IphonePhoto(self.file_path)
script_directory = os.path.dirname(os.path.abspath(__file__))
self.file_path = r"./iphone/IMG_1315_left.jpeg"
self.iphone_photo = IphonePhoto(os.path.join(script_directory, self.file_path))
self.iphone_photo.exif_data = self.iphone_photo._extract_exif_data()

def test_extract_date(self):
Expand Down

0 comments on commit df08d5b

Please sign in to comment.