You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@bloodhound.apache.org by Thimal Kempitiya <tk...@gmail.com> on 2014/08/12 18:55:39 UTC

Re: svn commit: r1617527 - /bloodhound/branches/bep_0013_dynamic_clientside_features/bloodhound_theme/bhtheme/tests/theme.py

added test cases to test internal methods in the keywordssuggest,
duplicateticketsearch and autocompleteusers. There some methods use the
env.get_known_users() methods I can't seem to test those methods as they
return empty string all the time


On Tue, Aug 12, 2014 at 10:20 PM, <th...@apache.org> wrote:

> Author: thimal
> Date: Tue Aug 12 16:50:37 2014
> New Revision: 1617527
>
> URL: http://svn.apache.org/r1617527
> Log:
> added the test cases to plugins added (autocompleteuser plugin)
>
> Modified:
>
> bloodhound/branches/bep_0013_dynamic_clientside_features/bloodhound_theme/bhtheme/tests/theme.py
>
> Modified:
> bloodhound/branches/bep_0013_dynamic_clientside_features/bloodhound_theme/bhtheme/tests/theme.py
> URL:
> http://svn.apache.org/viewvc/bloodhound/branches/bep_0013_dynamic_clientside_features/bloodhound_theme/bhtheme/tests/theme.py?rev=1617527&r1=1617526&r2=1617527&view=diff
>
> ==============================================================================
> ---
> bloodhound/branches/bep_0013_dynamic_clientside_features/bloodhound_theme/bhtheme/tests/theme.py
> (original)
> +++
> bloodhound/branches/bep_0013_dynamic_clientside_features/bloodhound_theme/bhtheme/tests/theme.py
> Tue Aug 12 16:50:37 2014
> @@ -63,12 +63,17 @@ class ThemeTestCase(unittest.TestCase):
>          for dir in self.bhtheme.get_templates_dirs():
>              self.assertIn(dir, chrome.get_all_templates_dirs())
>
> -    def test_get_users(self):
> +    def test_get_groups(self):
>
> -        self.req.args['term'] = 'adm'
> -        test_users = ['key1', 'key2', 'key3']
> -
> -        users = self.autocompleteuser_component._get_users(self.req)
> +        self.req.args['term'] = 'de'
> +        test_users = [u'dev']
> +        self.env.db_transaction.executemany(
> +            "INSERT INTO permission VALUES (%s,%s)",
> +            [('dev', 'WIKI_MODIFY'),
> +             ('dev', 'REPORT_ADMIN'),
> +             ('admin', 'REPORT_ADMIN')])
> +        gona=self.env.get_known_users()
> +        users = self.autocompleteuser_component._get_groups(self.req)
>          self.assertEqual(test_users, users)
>
>      def test_get_keywords_string(self):
>
>
>


-- 




*Thimal Kempitiya <http://www.facebook.com/thimalk> UndergraduateDepartment
of Computer Science and Engineering University of Moratuwa.*