# Path: uamobile/willcom.py
# class WillcomUserAgent(UserAgent):
#     name = 'WILLCOM'
#     carrier = 'WILLCOM'
#     short_carrier = 'W'
# 
#     def __init__(self, *args, **kwds):
#         super(WillcomUserAgent, self).__init__(*args, **kwds)
#         self.serialnumber = None
#         self.model_version = None
#         self.browser_version = None
# 
#     def get_flash_version(self):
#         """
#         returns Flash Lite version.
#         """
#         return None
#     flash_version = property(get_flash_version)
# 
#     def supports_cookie(self):
#         # TODO
#         # I'm not sure All WILLCOM phones can handle HTTP cookie.
#         return True
# 
#     def make_display(self):
#         """
#         create a new Display object.
#         """
#         return Display()
# 
#     def is_willcom(self):
#         return True
# 
#     def is_airhphone(self):
#         return True
# 
# Path: uamobile/factory/willcom.py
# class WillcomUserAgentFactory(AbstractUserAgentFactory):
#     device_class = WillcomUserAgent
#     parser       = CachingWillcomUserAgentParser()


from tests import msg
from uamobile import *
from uamobile.willcom import WillcomUserAgent
from uamobile.factory.willcom import WillcomUserAgentFactory
# -*- coding: utf-8 -*-

def test_detect_fast():
    assert detect_fast('Mozilla/3.0(WILLCOM;SANYO/WX310SA/2;1/1/C128) NetFront/3.3,61.198.142.127') == 'willcom'

def test_useragent():
    def inner(useragent, name, vendor, model, model_version, browser_version, cache_size):
        ua = detect({'HTTP_USER_AGENT': useragent})

        assert ua.is_willcom()
        assert ua.carrier == 'WILLCOM'
        assert ua.short_carrier == 'W'
        assert ua.name == name
        assert ua.vendor == vendor

# Path: uamobile/willcom.py
# class WillcomUserAgent(UserAgent):
#     name = 'WILLCOM'
#     carrier = 'WILLCOM'
#     short_carrier = 'W'
# 
#     def __init__(self, *args, **kwds):
#         super(WillcomUserAgent, self).__init__(*args, **kwds)
#         self.serialnumber = None
#         self.model_version = None
#         self.browser_version = None
# 
#     def get_flash_version(self):
#         """
#         returns Flash Lite version.
#         """
#         return None
#     flash_version = property(get_flash_version)
# 
#     def supports_cookie(self):
#         # TODO
#         # I'm not sure All WILLCOM phones can handle HTTP cookie.
#         return True
# 
#     def make_display(self):
#         """
#         create a new Display object.
#         """
#         return Display()
# 
#     def is_willcom(self):
#         return True
# 
#     def is_airhphone(self):
#         return True
# 
# Path: uamobile/factory/willcom.py
# class WillcomUserAgentFactory(AbstractUserAgentFactory):
#     device_class = WillcomUserAgent
#     parser       = CachingWillcomUserAgentParser()


# Path: tests/test_willcom.py
from tests import msg
from uamobile import *
from uamobile.willcom import WillcomUserAgent
from uamobile.factory.willcom import WillcomUserAgentFactory

# -*- coding: utf-8 -*-

def test_detect_fast():
    assert detect_fast('Mozilla/3.0(WILLCOM;SANYO/WX310SA/2;1/1/C128) NetFront/3.3,61.198.142.127') == 'willcom'

def test_useragent():
    def inner(useragent, name, vendor, model, model_version, browser_version, cache_size):
        ua = detect({'HTTP_USER_AGENT': useragent})

        assert ua.is_willcom()
        assert ua.carrier == 'WILLCOM'
        assert ua.short_carrier == 'W'
        assert ua.name == name
        assert ua.vendor == vendor

        assert ua.model == model, ua.model