=== chihchun_afk is now known as chihchun === chihchun is now known as chihchun_afk === chihchun_afk is now known as chihchun [15:11] elopio, hi, it's your favourite I-bug-you, any idea how to get rid of \ in https://github.com/Saviq/nova-compute-lxd/pull/3/files#diff-c80fca5016bdd3c8916dac9e8ba9a9fcR52 ? [15:11] I tried everything I could think of with (), but no go :/ [15:12] Saviq: many patches, that smells like not-so-easy to test code. [15:12] Saviq: but, you can make a patch, and then start it [15:13] instead of putting it inside the with statement. [15:13] elopio, yeah i was considering that, but that works and am quite happy, the only problem is I've no idea how to wrap without \ [15:13] Saviq: well, \ is not wrong. [15:14] elopio, sure, was just wondering if there's a solution :) [15:14] elopio, fwiw, here's the tested function https://github.com/Saviq/nova-compute-lxd/blob/travis/nclxd/nova/virt/lxd/container_config.py#L50 [15:15] there's a lot of self.foo() calls, hence all the mocks... [15:15] Saviq: ok, give me some moments and I'll check it. [15:16] I could move the patches a level up, tried to keep the test low level, though [15:16] elopio, thank [15:16] s === chihchun is now known as chihchun_afk [16:47] Saviq: sorry, long meeting and then forgot about you. [16:48] Saviq: why do you have to patch something like _init_container_config [16:48] doesn't seem to be slow, or to have any side-effects [16:50] it's an internal method, so you probably shouldn't write a unit test for it, but check it's behaviour through the public method that calls it. [16:54] yes, too many mocks. That usually happens when you try to do full coverage, but don't follow tdd. [16:55] Saviq: I would recommend to split the tests. I use a trick that if I can't properly name the test, it's probably wrong. [16:56] write first a test that's named like: test_configure_container_with_negative_memory_must_not_limit_memory [16:57] then write test_configure_container_with_positive_memory_must_limit_memory. [16:57] try passing to those methods a flavor that causes the if mem >= 0 to be taken, and a flavor that doesn't. And then check the container_config returned. [16:58] afai can see, you shouldn't need a mock to test that. [17:12] elopio, right, test for _init_container_config is probably overkill [17:12] elopio, and yeah, unfortunately I'm sticking tests on all that post-factum [17:16] mocking add_config probably doesn't make sense either, now I think of it [17:39] Saviq: appart from configure_container, the rest of the method seem internal to me. [17:39] maybe ask why are they public? [17:39] elopio, could be indeed, will check if they're even called anywhere et [19:37] bunosera Letozaf_ ! [19:38] buonasera balloons :) howzit ? [19:38] excellente. I was just talking with Akiva about the AP plugin [19:38] I was just thinking about those bugs you found.. do you mind filing them? [19:39] balloons, I will, I was just fighting getting Thunderbird to work, but I will just now [19:50] balloons, bug 1474108 [19:57] bug #1474108 [19:59] balloons, :-P forgot # [20:00] Letozaf_, the bot doesn't love us today.. No linky or print [20:03] balloons, :-) [20:29] balloons, bug #1474117 and bug #1474119