Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
255d6a26
Kaydet (Commit)
255d6a26
authored
Şub 11, 2019
tarafından
Semen Zhydenko
Kaydeden (comit)
Tim Graham
Şub 11, 2019
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed spelling mistakes in comments and tests.
üst
b6bb912e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
26 deletions
+26
-26
test_commands.py
tests/migrations/test_commands.py
+1
-1
tests.py
tests/urlpatterns/tests.py
+1
-1
test_autoreload.py
tests/utils_tests/test_autoreload.py
+24
-24
No files found.
tests/migrations/test_commands.py
Dosyayı görüntüle @
255d6a26
...
@@ -1535,7 +1535,7 @@ class SquashMigrationsTests(MigrationTestBase):
...
@@ -1535,7 +1535,7 @@ class SquashMigrationsTests(MigrationTestBase):
class
AppLabelErrorTests
(
TestCase
):
class
AppLabelErrorTests
(
TestCase
):
"""
"""
This class inherits TestCase because MigrationTestBase uses
This class inherits TestCase because MigrationTestBase uses
`availabe_apps = ['migrations']` which means that it's the only installed
`availab
l
e_apps = ['migrations']` which means that it's the only installed
app. 'django.contrib.auth' must be in INSTALLED_APPS for some of these
app. 'django.contrib.auth' must be in INSTALLED_APPS for some of these
tests.
tests.
"""
"""
...
...
tests/urlpatterns/tests.py
Dosyayı görüntüle @
255d6a26
...
@@ -198,7 +198,7 @@ class ConversionExceptionTests(SimpleTestCase):
...
@@ -198,7 +198,7 @@ class ConversionExceptionTests(SimpleTestCase):
with
self
.
assertRaises
(
Resolver404
):
with
self
.
assertRaises
(
Resolver404
):
resolve
(
'/dynamic/abc/'
)
resolve
(
'/dynamic/abc/'
)
def
test_resolve_type_error_prop
o
gates
(
self
):
def
test_resolve_type_error_prop
a
gates
(
self
):
@DynamicConverter.register_to_python
@DynamicConverter.register_to_python
def
raises_type_error
(
value
):
def
raises_type_error
(
value
):
raise
TypeError
(
'This type error propagates.'
)
raise
TypeError
(
'This type error propagates.'
)
...
...
tests/utils_tests/test_autoreload.py
Dosyayı görüntüle @
255d6a26
...
@@ -153,11 +153,11 @@ class TestSysPathDirectories(SimpleTestCase):
...
@@ -153,11 +153,11 @@ class TestSysPathDirectories(SimpleTestCase):
self
.
assertIn
(
self
.
file
.
parent
,
paths
)
self
.
assertIn
(
self
.
file
.
parent
,
paths
)
def
test_sys_paths_non_existing
(
self
):
def
test_sys_paths_non_existing
(
self
):
nonexist
a
nt_file
=
Path
(
self
.
directory
.
name
)
/
'does_not_exist'
nonexist
e
nt_file
=
Path
(
self
.
directory
.
name
)
/
'does_not_exist'
with
extend_sys_path
(
str
(
nonexist
a
nt_file
)):
with
extend_sys_path
(
str
(
nonexist
e
nt_file
)):
paths
=
list
(
autoreload
.
sys_path_directories
())
paths
=
list
(
autoreload
.
sys_path_directories
())
self
.
assertNotIn
(
nonexist
a
nt_file
,
paths
)
self
.
assertNotIn
(
nonexist
e
nt_file
,
paths
)
self
.
assertNotIn
(
nonexist
a
nt_file
.
parent
,
paths
)
self
.
assertNotIn
(
nonexist
e
nt_file
.
parent
,
paths
)
def
test_sys_paths_absolute
(
self
):
def
test_sys_paths_absolute
(
self
):
paths
=
list
(
autoreload
.
sys_path_directories
())
paths
=
list
(
autoreload
.
sys_path_directories
())
...
@@ -325,7 +325,7 @@ class ReloaderTests(SimpleTestCase):
...
@@ -325,7 +325,7 @@ class ReloaderTests(SimpleTestCase):
self
.
_tempdir
=
tempfile
.
TemporaryDirectory
()
self
.
_tempdir
=
tempfile
.
TemporaryDirectory
()
self
.
tempdir
=
Path
(
self
.
_tempdir
.
name
)
.
resolve
()
.
absolute
()
self
.
tempdir
=
Path
(
self
.
_tempdir
.
name
)
.
resolve
()
.
absolute
()
self
.
existing_file
=
self
.
ensure_file
(
self
.
tempdir
/
'test.py'
)
self
.
existing_file
=
self
.
ensure_file
(
self
.
tempdir
/
'test.py'
)
self
.
nonexist
a
nt_file
=
(
self
.
tempdir
/
'does_not_exist.py'
)
.
absolute
()
self
.
nonexist
e
nt_file
=
(
self
.
tempdir
/
'does_not_exist.py'
)
.
absolute
()
self
.
reloader
=
self
.
RELOADER_CLS
()
self
.
reloader
=
self
.
RELOADER_CLS
()
def
tearDown
(
self
):
def
tearDown
(
self
):
...
@@ -370,23 +370,23 @@ class IntegrationTests:
...
@@ -370,23 +370,23 @@ class IntegrationTests:
@mock.patch
(
'django.utils.autoreload.BaseReloader.notify_file_changed'
)
@mock.patch
(
'django.utils.autoreload.BaseReloader.notify_file_changed'
)
@mock.patch
(
'django.utils.autoreload.iter_all_python_module_files'
,
return_value
=
frozenset
())
@mock.patch
(
'django.utils.autoreload.iter_all_python_module_files'
,
return_value
=
frozenset
())
def
test_nonexist
a
nt_file
(
self
,
mocked_modules
,
notify_mock
):
def
test_nonexist
e
nt_file
(
self
,
mocked_modules
,
notify_mock
):
self
.
reloader
.
watch_file
(
self
.
nonexist
a
nt_file
)
self
.
reloader
.
watch_file
(
self
.
nonexist
e
nt_file
)
with
self
.
tick_twice
():
with
self
.
tick_twice
():
self
.
ensure_file
(
self
.
nonexist
a
nt_file
)
self
.
ensure_file
(
self
.
nonexist
e
nt_file
)
self
.
assertEqual
(
notify_mock
.
call_count
,
1
)
self
.
assertEqual
(
notify_mock
.
call_count
,
1
)
self
.
assertCountEqual
(
notify_mock
.
call_args
[
0
],
[
self
.
nonexist
a
nt_file
])
self
.
assertCountEqual
(
notify_mock
.
call_args
[
0
],
[
self
.
nonexist
e
nt_file
])
@mock.patch
(
'django.utils.autoreload.BaseReloader.notify_file_changed'
)
@mock.patch
(
'django.utils.autoreload.BaseReloader.notify_file_changed'
)
@mock.patch
(
'django.utils.autoreload.iter_all_python_module_files'
,
return_value
=
frozenset
())
@mock.patch
(
'django.utils.autoreload.iter_all_python_module_files'
,
return_value
=
frozenset
())
def
test_nonexist
a
nt_file_in_non_existing_directory
(
self
,
mocked_modules
,
notify_mock
):
def
test_nonexist
e
nt_file_in_non_existing_directory
(
self
,
mocked_modules
,
notify_mock
):
non_existing_directory
=
self
.
tempdir
/
'non_existing_dir'
non_existing_directory
=
self
.
tempdir
/
'non_existing_dir'
nonexist
a
nt_file
=
non_existing_directory
/
'test'
nonexist
e
nt_file
=
non_existing_directory
/
'test'
self
.
reloader
.
watch_file
(
nonexist
a
nt_file
)
self
.
reloader
.
watch_file
(
nonexist
e
nt_file
)
with
self
.
tick_twice
():
with
self
.
tick_twice
():
self
.
ensure_file
(
nonexist
a
nt_file
)
self
.
ensure_file
(
nonexist
e
nt_file
)
self
.
assertEqual
(
notify_mock
.
call_count
,
1
)
self
.
assertEqual
(
notify_mock
.
call_count
,
1
)
self
.
assertCountEqual
(
notify_mock
.
call_args
[
0
],
[
nonexist
a
nt_file
])
self
.
assertCountEqual
(
notify_mock
.
call_args
[
0
],
[
nonexist
e
nt_file
])
@mock.patch
(
'django.utils.autoreload.BaseReloader.notify_file_changed'
)
@mock.patch
(
'django.utils.autoreload.BaseReloader.notify_file_changed'
)
@mock.patch
(
'django.utils.autoreload.iter_all_python_module_files'
,
return_value
=
frozenset
())
@mock.patch
(
'django.utils.autoreload.iter_all_python_module_files'
,
return_value
=
frozenset
())
...
@@ -403,13 +403,13 @@ class IntegrationTests:
...
@@ -403,13 +403,13 @@ class IntegrationTests:
@mock.patch
(
'django.utils.autoreload.iter_all_python_module_files'
,
return_value
=
frozenset
())
@mock.patch
(
'django.utils.autoreload.iter_all_python_module_files'
,
return_value
=
frozenset
())
def
test_glob_non_existing_directory
(
self
,
mocked_modules
,
notify_mock
):
def
test_glob_non_existing_directory
(
self
,
mocked_modules
,
notify_mock
):
non_existing_directory
=
self
.
tempdir
/
'does_not_exist'
non_existing_directory
=
self
.
tempdir
/
'does_not_exist'
nonexist
a
nt_file
=
non_existing_directory
/
'test.py'
nonexist
e
nt_file
=
non_existing_directory
/
'test.py'
self
.
reloader
.
watch_dir
(
non_existing_directory
,
'*.py'
)
self
.
reloader
.
watch_dir
(
non_existing_directory
,
'*.py'
)
with
self
.
tick_twice
():
with
self
.
tick_twice
():
self
.
ensure_file
(
nonexist
a
nt_file
)
self
.
ensure_file
(
nonexist
e
nt_file
)
self
.
set_mtime
(
nonexist
a
nt_file
,
time
.
time
())
self
.
set_mtime
(
nonexist
e
nt_file
,
time
.
time
())
self
.
assertEqual
(
notify_mock
.
call_count
,
1
)
self
.
assertEqual
(
notify_mock
.
call_count
,
1
)
self
.
assertCountEqual
(
notify_mock
.
call_args
[
0
],
[
nonexist
a
nt_file
])
self
.
assertCountEqual
(
notify_mock
.
call_args
[
0
],
[
nonexist
e
nt_file
])
@mock.patch
(
'django.utils.autoreload.BaseReloader.notify_file_changed'
)
@mock.patch
(
'django.utils.autoreload.BaseReloader.notify_file_changed'
)
@mock.patch
(
'django.utils.autoreload.iter_all_python_module_files'
,
return_value
=
frozenset
())
@mock.patch
(
'django.utils.autoreload.iter_all_python_module_files'
,
return_value
=
frozenset
())
...
@@ -640,7 +640,7 @@ class StatReloaderTests(ReloaderTests, IntegrationTests):
...
@@ -640,7 +640,7 @@ class StatReloaderTests(ReloaderTests, IntegrationTests):
self
.
reloader
.
SLEEP_TIME
=
0.01
self
.
reloader
.
SLEEP_TIME
=
0.01
def
test_snapshot_files_ignores_missing_files
(
self
):
def
test_snapshot_files_ignores_missing_files
(
self
):
with
mock
.
patch
.
object
(
self
.
reloader
,
'watched_files'
,
return_value
=
[
self
.
nonexist
a
nt_file
]):
with
mock
.
patch
.
object
(
self
.
reloader
,
'watched_files'
,
return_value
=
[
self
.
nonexist
e
nt_file
]):
self
.
assertEqual
(
dict
(
self
.
reloader
.
snapshot_files
()),
{})
self
.
assertEqual
(
dict
(
self
.
reloader
.
snapshot_files
()),
{})
def
test_snapshot_files_updates
(
self
):
def
test_snapshot_files_updates
(
self
):
...
@@ -661,13 +661,13 @@ class StatReloaderTests(ReloaderTests, IntegrationTests):
...
@@ -661,13 +661,13 @@ class StatReloaderTests(ReloaderTests, IntegrationTests):
notifier
.
assert_not_called
()
notifier
.
assert_not_called
()
def
test_fires_when_created
(
self
):
def
test_fires_when_created
(
self
):
with
mock
.
patch
.
object
(
self
.
reloader
,
'watched_files'
,
return_value
=
[
self
.
nonexist
a
nt_file
]),
\
with
mock
.
patch
.
object
(
self
.
reloader
,
'watched_files'
,
return_value
=
[
self
.
nonexist
e
nt_file
]),
\
mock
.
patch
.
object
(
self
.
reloader
,
'notify_file_changed'
)
as
notifier
:
mock
.
patch
.
object
(
self
.
reloader
,
'notify_file_changed'
)
as
notifier
:
self
.
nonexist
a
nt_file
.
touch
()
self
.
nonexist
e
nt_file
.
touch
()
mtime
=
self
.
nonexist
a
nt_file
.
stat
()
.
st_mtime
mtime
=
self
.
nonexist
e
nt_file
.
stat
()
.
st_mtime
second_snapshot
=
self
.
reloader
.
loop_files
({},
mtime
-
1
)
second_snapshot
=
self
.
reloader
.
loop_files
({},
mtime
-
1
)
self
.
assertCountEqual
(
second_snapshot
.
keys
(),
[
self
.
nonexist
a
nt_file
])
self
.
assertCountEqual
(
second_snapshot
.
keys
(),
[
self
.
nonexist
e
nt_file
])
notifier
.
assert_called_once_with
(
self
.
nonexist
a
nt_file
)
notifier
.
assert_called_once_with
(
self
.
nonexist
e
nt_file
)
def
test_fires_with_changes
(
self
):
def
test_fires_with_changes
(
self
):
with
mock
.
patch
.
object
(
self
.
reloader
,
'watched_files'
,
return_value
=
[
self
.
existing_file
]),
\
with
mock
.
patch
.
object
(
self
.
reloader
,
'watched_files'
,
return_value
=
[
self
.
existing_file
]),
\
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment