Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cubes
awstats
Commits
41cf9ff3fd50
Commit
cb5c1e73
authored
Jul 25, 2014
by
Julien Cristau
Browse files
[test] port to cubicweb 3.19
parent
65a4bd1c8161
Changes
4
Hide whitespace changes
Inline
Side-by-side
__pkginfo__.py
View file @
41cf9ff3
...
@@ -13,7 +13,7 @@ author_email = 'contact@logilab.fr'
...
@@ -13,7 +13,7 @@ author_email = 'contact@logilab.fr'
description
=
'cubicweb integrated awstats frontend'
description
=
'cubicweb integrated awstats frontend'
web
=
'http://www.cubicweb.org/project/%s'
%
distname
web
=
'http://www.cubicweb.org/project/%s'
%
distname
__depends__
=
{
'cubicweb'
:
'>= 3.1
5
.0'
,}
__depends__
=
{
'cubicweb'
:
'>= 3.1
9
.0'
,}
__recommends__
=
{
'cubicweb-raphael'
:
None
,}
__recommends__
=
{
'cubicweb-raphael'
:
None
,}
classifiers
=
[
classifiers
=
[
...
...
cubicweb-awstats.spec
View file @
41cf9ff3
...
@@ -20,7 +20,7 @@ BuildArch: noarch
...
@@ -20,7 +20,7 @@ BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
BuildRequires: %{python} %{python}-setuptools
BuildRequires: %{python} %{python}-setuptools
Requires: cubicweb >= 3.1
5
.0
Requires: cubicweb >= 3.1
9
.0
%description
%description
awstats component for the CubicWeb framework
awstats component for the CubicWeb framework
...
...
debian/control
View file @
41cf9ff3
...
@@ -10,7 +10,7 @@ Homepage: http://www.cubicweb.org/project/awstats
...
@@ -10,7 +10,7 @@ Homepage: http://www.cubicweb.org/project/awstats
Package: cubicweb-awstats
Package: cubicweb-awstats
Architecture: all
Architecture: all
Depends: cubicweb-common (>= 3.1
5
.0)
Depends: cubicweb-common (>= 3.1
9
.0)
Recommends: cubicweb-raphael
Recommends: cubicweb-raphael
Description: cubicweb integrated awstats frontend
Description: cubicweb integrated awstats frontend
CubicWeb is a semantic web application framework.
CubicWeb is a semantic web application framework.
...
...
test/test_compress.py
View file @
41cf9ff3
...
@@ -11,20 +11,20 @@ from cubes.awstats.utils import compress_old_hits
...
@@ -11,20 +11,20 @@ from cubes.awstats.utils import compress_old_hits
class
CompressTest
(
CubicWebTC
):
class
CompressTest
(
CubicWebTC
):
def
test_compress
(
self
):
def
test_compress
(
self
):
req
=
self
.
request
()
with
self
.
admin_access
.
client_cnx
()
as
cnx
:
update_stats
=
defaultdict
(
int
)
update_stats
=
defaultdict
(
int
)
content
=
req
.
create_entity
(
'Content'
,
title
=
u
'test'
)
content
=
cnx
.
create_entity
(
'Content'
,
title
=
u
'test'
)
for
day
in
date
.
date_range
(
datetime
.
now
()
-
timedelta
(
200
),
datetime
.
now
()):
for
day
in
date
.
date_range
(
datetime
.
now
()
-
timedelta
(
200
),
datetime
.
now
()):
stp
=
req
.
create_entity
(
'StatPeriod'
,
start
=
day
,
stop
=
day
+
timedelta
(
1
))
stp
=
cnx
.
create_entity
(
'StatPeriod'
,
start
=
day
,
stop
=
day
+
timedelta
(
1
))
hit
=
req
.
create_entity
(
'Hits'
,
hit_type
=
u
'normal'
,
hit
=
cnx
.
create_entity
(
'Hits'
,
hit_type
=
u
'normal'
,
count
=
random
.
choice
(
range
(
2000
)),
count
=
random
.
choice
(
range
(
2000
)),
period
=
stp
,
stats_about
=
content
)
period
=
stp
,
stats_about
=
content
)
self
.
assertEqual
(
len
(
req
.
execute
(
'Any X WHERE X is Hits'
)),
200
)
self
.
assertEqual
(
len
(
cnx
.
execute
(
'Any X WHERE X is Hits'
)),
200
)
self
.
assertEqual
(
len
(
req
.
execute
(
'Any P WHERE P is StatPeriod, P start S, P stop E HAVING E-S >= 27'
)),
0
)
self
.
assertEqual
(
len
(
cnx
.
execute
(
'Any P WHERE P is StatPeriod, P start S, P stop E HAVING E-S >= 27'
)),
0
)
compress_old_hits
(
req
,
update_stats
)
compress_old_hits
(
cnx
,
update_stats
)
# XXX SQLite bug ?
# XXX SQLite bug ?
# self.assertEqual(len(req.execute('Any P WHERE P is StatPeriod, P start S, P stop E HAVING E-S >= 27')), 9)
# self.assertEqual(len(req.execute('Any P WHERE P is StatPeriod, P start S, P stop E HAVING E-S >= 27')), 9)
self
.
assertNotEqual
(
len
(
req
.
execute
(
'Any X WHERE X is Hits'
)),
200
)
self
.
assertNotEqual
(
len
(
cnx
.
execute
(
'Any X WHERE X is Hits'
)),
200
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
...
...
Write
Preview
Supports
Markdown
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