def test_empty_package_will_still_work(self): profile = Profile(name='package_filt') self.assertTrue( profile.include({ 'message': 'Start proc com.example.test for activity tw.com.xxxx.android.yyyy/.333Activity: pid=123456 uid=10105 gids={3003}' }))
def test_package_name_filter(self): profile = Profile(name='package_filt', packages=['com.example.test']) self.assertFalse( profile.include({ 'message': 'Start proc com.example.test for activity tw.com.xxxx.android.yyyy/.333Activity: pid=123456 uid=10105 gids={3003}' })) self.assertTrue( profile.include({ 'pid': '123456', 'message': 'foo bar' }))
def __init__(self, args=None): self.parse_args(args) self.width = self.get_term_width() self.config = LogcatColorConfig(self.options) self.profile = None if len(self.args) >= 1: self.profile = Profile.get_profile(self.args[0]) if self.profile: self.args = self.args[1:] if not self.profile: self.logcat_args.extend(self.args) self.format = None if self.options.format: self.format = self.options.format elif self.profile and self.profile.format: self.format = self.profile.format self.layout = self.format if self.options.plain: self.layout = "raw"
def test_empty_package_will_still_work(self): profile = Profile(name = 'package_filt') self.assertTrue(profile.include({'message' : 'Start proc com.example.test for activity tw.com.xxxx.android.yyyy/.333Activity: pid=123456 uid=10105 gids={3003}'}))
def test_package_name_filter(self): profile = Profile(name = 'package_filt', packages = ['com.example.test']) self.assertFalse(profile.include({'message' : 'Start proc com.example.test for activity tw.com.xxxx.android.yyyy/.333Activity: pid=123456 uid=10105 gids={3003}'})) self.assertTrue(profile.include({'pid' : '123456', 'message' : 'foo bar'}))